瀏覽代碼

Example reviewed (more clear now)

pull/76/head
raysan5 9 年之前
父節點
當前提交
4f0165f32d
共有 1 個檔案被更改,包括 8 行新增5 行删除
  1. +8
    -5
      examples/core_3d_mode.c

+ 8
- 5
examples/core_3d_mode.c 查看文件

@ -21,11 +21,14 @@ int main()
InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d mode");
// Define the camera to look into our 3d world
Camera camera = {{ 0.0, 10.0, 10.0 }, { 0.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0 }};
Camera camera;
camera.position = (Vector3){ 0.0, 10.0, 10.0 };
camera.target = (Vector3){ 0.0, 0.0, 0.0 };
camera.up = (Vector3){ 0.0, 1.0, 0.0 };
Vector3 cubePosition = { 0.0, 0.0, 0.0 };
o">//SetTargetFPS(60); // Set our game to run at 60 frames-per-second, but not now...
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
@ -40,12 +43,12 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(WHITE);
ClearBackground(RAYWHITE);
Begin3dMode(camera);
DrawCube(cubePosition, i">2, 2, 2, RED);
DrawCubeWires(cubePosition, i">2, 2, 2, MAROON);
DrawCube(cubePosition, f">2.0, 2.0, 2.0, RED);
DrawCubeWires(cubePosition, f">2.0, 2.0, 2.0, MAROON);
DrawGrid(10.0, 1.0);

Loading…
取消
儲存