diff options
| author | Ray San <raysan5@gmail.com> | 2018-04-11 10:13:00 +0200 |
|---|---|---|
| committer | Ray San <raysan5@gmail.com> | 2018-04-11 10:13:00 +0200 |
| commit | 4cc12ef2b32f66f160e4e401e5cd76d1740eaf61 (patch) | |
| tree | f9a43a0d3e69aa430e3a8152bb6b5b9268c3b1be /examples/core | |
| parent | cc3b8645df23ed9aeb9d6efc806ab91170a29a89 (diff) | |
| download | raylib-4cc12ef2b32f66f160e4e401e5cd76d1740eaf61.tar.gz raylib-4cc12ef2b32f66f160e4e401e5cd76d1740eaf61.zip | |
Review camera definition on examples
Diffstat (limited to 'examples/core')
| -rw-r--r-- | examples/core/core_3d_camera_first_person.c | 7 | ||||
| -rw-r--r-- | examples/core/core_world_screen.c | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/examples/core/core_3d_camera_first_person.c b/examples/core/core_3d_camera_first_person.c index 3998af81..775e6c57 100644 --- a/examples/core/core_3d_camera_first_person.c +++ b/examples/core/core_3d_camera_first_person.c @@ -23,7 +23,12 @@ int main() InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d camera first person"); // Define the camera to look into our 3d world (position, target, up vector) - Camera camera = {{ 4.0f, 2.0f, 4.0f }, { 0.0f, 1.8f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 60.0f }; + Camera camera = { 0 }; + camera.position = (Vector3){ 4.0f, 2.0f, 4.0f }; + camera.target = (Vector3){ 0.0f, 1.8f, 0.0f }; + camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; + camera.fovy = 60.0f; + camera.type = CAMERA_PERSPECTIVE; // Generates some random columns float heights[MAX_COLUMNS]; diff --git a/examples/core/core_world_screen.c b/examples/core/core_world_screen.c index f8c53c70..78ca6eb4 100644 --- a/examples/core/core_world_screen.c +++ b/examples/core/core_world_screen.c @@ -21,7 +21,12 @@ int main() InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d camera free"); // Define the camera to look into our 3d world - Camera camera = {{ 10.0f, 10.0f, 10.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f }; + Camera camera = { 0 }; + camera.position = (Vector3){ 10.0f, 10.0f, 10.0f }; + camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; + camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; + camera.fovy = 45.0f; + camera.type = CAMERA_PERSPECTIVE; Vector3 cubePosition = { 0.0f, 0.0f, 0.0f }; |
