From c041bb4f79c24460e958bb3f857ea9e162209c51 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 10 Jul 2017 01:09:25 +0200 Subject: [PATCH] Improved examples --- examples/models/models_cubicmap.c | 7 ++----- examples/models/models_skybox.c | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/models/models_cubicmap.c b/examples/models/models_cubicmap.c index dbcd0ba2d..a5cb30a49 100644 --- a/examples/models/models_cubicmap.c +++ b/examples/models/models_cubicmap.c @@ -10,7 +10,6 @@ ********************************************************************************************/ #include "raylib.h" - #include "raymath.h" int main() @@ -28,10 +27,8 @@ int main() Image image = LoadImage("resources/cubicmap.png"); // Load cubicmap image (RAM) Texture2D cubicmap = LoadTextureFromImage(image); // Convert image to texture to display (VRAM) - Model model; - model.mesh = LoadMeshCubicmap(image); // Load cubicmap mesh (generated from image) - model.transform = MatrixIdentity(); // Set default transform matrix - model.material = LoadMaterialDefault(); // Load default material + Mesh mesh = GenMeshCubicmap(image, VectorOne()); + Model model = LoadModelFromMesh(mesh, false); // NOTE: By default each cube is mapped to one part of texture atlas Texture2D texture = LoadTexture("resources/cubicmap_atlas.png"); // Load map texture diff --git a/examples/models/models_skybox.c b/examples/models/models_skybox.c index e07c9cfa5..1c5f62492 100644 --- a/examples/models/models_skybox.c +++ b/examples/models/models_skybox.c @@ -43,7 +43,7 @@ int main() skybox.material.shader.locs[LOC_MATRIX_VIEW] = GetShaderLocation(skybox.material.shader, "view"); // Then before rendering, configure the viewport to the actual screen dimensions - Matrix proj = MatrixPerspective(45.0, (double)GetScreenWidth()/(double)GetScreenHeight(), 0.01, 1000.0); + Matrix proj = MatrixPerspective(60.0, (double)GetScreenWidth()/(double)GetScreenHeight(), 0.01, 1000.0); MatrixTranspose(&proj); SetShaderValueMatrix(skybox.material.shader, skyProjectionLoc, proj);