Browse Source

Reviewed examples

Ray 7 năm trước cách đây
mục cha
commit
245704df72

+ 1 - 0
examples/core/core_3d_camera_free.c

@@ -26,6 +26,7 @@ int main()
     camera.target = (Vector3){ 0.0f, 0.0f, 0.0f };      // Camera looking at point
     camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };          // Camera up vector (rotation towards target)
     camera.fovy = 45.0f;                                // Camera field-of-view Y
+    camera.type = CAMERA_PERSPECTIVE;                   // Camera mode type
     
     Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };
     

+ 1 - 0
examples/core/core_3d_mode.c

@@ -26,6 +26,7 @@ int main()
     camera.target = (Vector3){ 0.0f, 0.0f, 0.0f };      // Camera looking at point
     camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };          // Camera up vector (rotation towards target)
     camera.fovy = 45.0f;                                // Camera field-of-view Y
+    camera.type = CAMERA_PERSPECTIVE;                   // Camera mode type
 
     Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };
 

+ 1 - 0
examples/core/core_3d_picking.c

@@ -26,6 +26,7 @@ int main()
     camera.target = (Vector3){ 0.0f, 0.0f, 0.0f };      // Camera looking at point
     camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };          // Camera up vector (rotation towards target)
     camera.fovy = 45.0f;                                // Camera field-of-view Y
+    camera.type = CAMERA_PERSPECTIVE;                   // Camera mode type
 
     Vector3 cubePosition = { 0.0f, 1.0f, 0.0f };
     Vector3 cubeSize = { 2.0f, 2.0f, 2.0f };

+ 4 - 4
examples/core/core_input_keys.c

@@ -30,10 +30,10 @@ int main()
     {
         // Update
         //----------------------------------------------------------------------------------
-        if (IsKeyDown(KEY_RIGHT)) ballPosition.x += 0.8f;
-        if (IsKeyDown(KEY_LEFT)) ballPosition.x -= 0.8f;
-        if (IsKeyDown(KEY_UP)) ballPosition.y -= 0.8f;
-        if (IsKeyDown(KEY_DOWN)) ballPosition.y += 0.8f;
+        if (IsKeyDown(KEY_RIGHT)) ballPosition.x += 2.0f;
+        if (IsKeyDown(KEY_LEFT)) ballPosition.x -= 2.0f;
+        if (IsKeyDown(KEY_UP)) ballPosition.y -= 2.0f;
+        if (IsKeyDown(KEY_DOWN)) ballPosition.y += 2.0f;
         //----------------------------------------------------------------------------------
 
         // Draw

+ 1 - 0
examples/models/models_mesh_picking.c

@@ -30,6 +30,7 @@ int main()
     camera.target = (Vector3){ 0.0f, 2.3f, 0.0f };      // Camera looking at point
     camera.up = (Vector3){ 0.0f, 1.6f, 0.0f };          // Camera up vector (rotation towards target)
     camera.fovy = 45.0f;                                // Camera field-of-view Y
+    camera.type = CAMERA_PERSPECTIVE;                   // Camera mode type
 
     Ray ray;        // Picking ray
     

+ 5 - 5
examples/models/models_obj_loading.c

@@ -22,11 +22,11 @@ int main()
 
     // Define the camera to look into our 3d world
     Camera camera = { 0 };
-    camera.position = (Vector3){ 3.0f, 3.0f, 3.0f };
-    camera.target = (Vector3){ 0.0f, 1.5f, 0.0f };
-    camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };
-    camera.fovy = 45.0f;
-    camera.type = CAMERA_PERSPECTIVE;
+    camera.position = (Vector3){ 3.0f, 3.0f, 3.0f };    // Camera position
+    camera.target = (Vector3){ 0.0f, 1.5f, 0.0f };      // Camera looking at point
+    camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };          // Camera up vector (rotation towards target)
+    camera.fovy = 45.0f;                                // Camera field-of-view Y
+    camera.type = CAMERA_PERSPECTIVE;                   // Camera mode type
 
     Model dwarf = LoadModel("resources/model/dwarf.obj");                   // Load OBJ model
     Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png");   // Load model texture