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/shaders | |
| parent | cc3b8645df23ed9aeb9d6efc806ab91170a29a89 (diff) | |
| download | raylib-4cc12ef2b32f66f160e4e401e5cd76d1740eaf61.tar.gz raylib-4cc12ef2b32f66f160e4e401e5cd76d1740eaf61.zip | |
Review camera definition on examples
Diffstat (limited to 'examples/shaders')
| -rw-r--r-- | examples/shaders/shaders_custom_uniform.c | 7 | ||||
| -rw-r--r-- | examples/shaders/shaders_model_shader.c | 7 | ||||
| -rw-r--r-- | examples/shaders/shaders_postprocessing.c | 2 |
3 files changed, 13 insertions, 3 deletions
diff --git a/examples/shaders/shaders_custom_uniform.c b/examples/shaders/shaders_custom_uniform.c index a0f6fd22..4e160455 100644 --- a/examples/shaders/shaders_custom_uniform.c +++ b/examples/shaders/shaders_custom_uniform.c @@ -30,7 +30,12 @@ int main() InitWindow(screenWidth, screenHeight, "raylib [shaders] example - custom uniform variable"); // Define the camera to look into our 3d world - Camera camera = {{ 3.0f, 3.0f, 3.0f }, { 0.0f, 1.5f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f }; + 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; Model dwarf = LoadModel("resources/model/dwarf.obj"); // Load OBJ model Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture (diffuse map) diff --git a/examples/shaders/shaders_model_shader.c b/examples/shaders/shaders_model_shader.c index f1a349c6..51acc836 100644 --- a/examples/shaders/shaders_model_shader.c +++ b/examples/shaders/shaders_model_shader.c @@ -30,7 +30,12 @@ int main() InitWindow(screenWidth, screenHeight, "raylib [shaders] example - model shader"); // Define the camera to look into our 3d world - Camera camera = {{ 3.0f, 3.0f, 3.0f }, { 0.0f, 1.5f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f }; + 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; Model dwarf = LoadModel("resources/model/dwarf.obj"); // Load OBJ model Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture diff --git a/examples/shaders/shaders_postprocessing.c b/examples/shaders/shaders_postprocessing.c index b8b5f6ae..5eeda896 100644 --- a/examples/shaders/shaders_postprocessing.c +++ b/examples/shaders/shaders_postprocessing.c @@ -70,7 +70,7 @@ int main() InitWindow(screenWidth, screenHeight, "raylib [shaders] example - postprocessing shader"); // Define the camera to look into our 3d world - Camera camera = {{ 3.0f, 3.0f, 3.0f }, { 0.0f, 1.5f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f }; + Camera camera = {{ 3.0f, 3.0f, 3.0f }, { 0.0f, 1.5f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f, 0 }; Model dwarf = LoadModel("resources/model/dwarf.obj"); // Load OBJ model Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture (diffuse map) |
