diff options
| author | Ray <[email protected]> | 2023-02-14 20:00:51 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2023-02-14 20:00:51 +0100 |
| commit | ea590c44a967075b3f6b420fa76e6387075ecf1d (patch) | |
| tree | b456de45fef83507415dcc309c05e64cb9232946 /examples/shaders/shaders_fog.c | |
| parent | 73989a49817225f11f547d270598e93745bf7df0 (diff) | |
| download | raylib-ea590c44a967075b3f6b420fa76e6387075ecf1d.tar.gz raylib-ea590c44a967075b3f6b420fa76e6387075ecf1d.zip | |
REVIEWED: Camera redesign PR
Diffstat (limited to 'examples/shaders/shaders_fog.c')
| -rw-r--r-- | examples/shaders/shaders_fog.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/examples/shaders/shaders_fog.c b/examples/shaders/shaders_fog.c index c4b619ed..ddd721d4 100644 --- a/examples/shaders/shaders_fog.c +++ b/examples/shaders/shaders_fog.c @@ -45,11 +45,12 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [shaders] example - fog"); // Define the camera to look into our 3d world - Camera camera = { - (Vector3){ 2.0f, 2.0f, 6.0f }, // position - (Vector3){ 0.0f, 0.5f, 0.0f }, // target - (Vector3){ 0.0f, 1.0f, 0.0f }, // up - 45.0f, CAMERA_PERSPECTIVE }; // fov, type + Camera camera = { 0 }; + camera.position = (Vector3){ 2.0f, 2.0f, 6.0f }; // Camera position + camera.target = (Vector3){ 0.0f, 0.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.projection = CAMERA_PERSPECTIVE; // Camera projection type // Load models and texture Model modelA = LoadModelFromMesh(GenMeshTorus(0.4f, 1.0f, 16, 32)); @@ -84,12 +85,12 @@ int main(void) // Using just 1 point lights CreateLight(LIGHT_POINT, (Vector3){ 0, 2, 6 }, Vector3Zero(), WHITE, shader); - DisableCursor(); // Catch cursor - SetTargetFPS(60); // Set our game to run at 60 frames-per-second + DisableCursor(); // Limit cursor to relative movement inside the window + SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- // Main game loop - while (!WindowShouldClose()) // Detect window close button or ESC key + while (!WindowShouldClose()) // Detect window close button or ESC key { // Update //---------------------------------------------------------------------------------- |
