diff options
| author | Ray <[email protected]> | 2018-06-30 20:02:32 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2018-06-30 20:02:32 +0200 |
| commit | a1d9c3399558842f3b4faf00a92db5badb6a4b9f (patch) | |
| tree | 035e49af39440510ace423dc811f1c685d5f560d /examples/shaders/shaders_model_shader.c | |
| parent | c8b378ae50ce8ef219c2b6f1d28543d3465e386c (diff) | |
| download | raylib-a1d9c3399558842f3b4faf00a92db5badb6a4b9f.tar.gz raylib-a1d9c3399558842f3b4faf00a92db5badb6a4b9f.zip | |
Reviewed models and examples
Diffstat (limited to 'examples/shaders/shaders_model_shader.c')
| -rw-r--r-- | examples/shaders/shaders_model_shader.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/shaders/shaders_model_shader.c b/examples/shaders/shaders_model_shader.c index 3ce9c6a3..e80d1fdc 100644 --- a/examples/shaders/shaders_model_shader.c +++ b/examples/shaders/shaders_model_shader.c @@ -31,19 +31,19 @@ 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.position = (Vector3){ 4.0f, 4.0f, 4.0f }; + camera.target = (Vector3){ 0.0f, 1.0f, -1.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 + Model model = LoadModel("resources/models/watermill.obj"); // Load OBJ model + Texture2D texture = LoadTexture("resources/models/watermill_diffuse.png"); // Load model texture Shader shader = LoadShader("resources/shaders/glsl330/base.vs", "resources/shaders/glsl330/grayscale.fs"); // Load model shader - dwarf.material.shader = shader; // Set shader effect to 3d model - dwarf.material.maps[MAP_DIFFUSE].texture = texture; // Bind texture to model + model.material.shader = shader; // Set shader effect to 3d model + model.material.maps[MAP_DIFFUSE].texture = texture; // Bind texture to model Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position @@ -68,13 +68,13 @@ int main() BeginMode3D(camera); - DrawModel(dwarf, position, 2.0f, WHITE); // Draw 3d model with texture + DrawModel(model, position, 0.2f, WHITE); // Draw 3d model with texture DrawGrid(10, 1.0f); // Draw a grid EndMode3D(); - DrawText("(c) Dwarf 3D model by David Moreno", screenWidth - 200, screenHeight - 20, 10, GRAY); + DrawText("(c) Watermill 3D model by Alberto Cano", screenWidth - 210, screenHeight - 20, 10, GRAY); DrawText(FormatText("Camera position: (%.2f, %.2f, %.2f)", camera.position.x, camera.position.y, camera.position.z), 600, 20, 10, BLACK); DrawText(FormatText("Camera target: (%.2f, %.2f, %.2f)", camera.target.x, camera.target.y, camera.target.z), 600, 40, 10, GRAY); @@ -89,7 +89,7 @@ int main() //-------------------------------------------------------------------------------------- UnloadShader(shader); // Unload shader UnloadTexture(texture); // Unload texture - UnloadModel(dwarf); // Unload model + UnloadModel(model); // Unload model CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- |
