Improved examples

This commit is contained in:
raysan5 2017-07-10 01:09:25 +02:00
parent 450f0645ed
commit c041bb4f79
2 changed files with 3 additions and 6 deletions

View File

@ -10,7 +10,6 @@
********************************************************************************************/ ********************************************************************************************/
#include "raylib.h" #include "raylib.h"
#include "raymath.h" #include "raymath.h"
int main() int main()
@ -28,10 +27,8 @@ int main()
Image image = LoadImage("resources/cubicmap.png"); // Load cubicmap image (RAM) Image image = LoadImage("resources/cubicmap.png"); // Load cubicmap image (RAM)
Texture2D cubicmap = LoadTextureFromImage(image); // Convert image to texture to display (VRAM) Texture2D cubicmap = LoadTextureFromImage(image); // Convert image to texture to display (VRAM)
Model model; Mesh mesh = GenMeshCubicmap(image, VectorOne());
model.mesh = LoadMeshCubicmap(image); // Load cubicmap mesh (generated from image) Model model = LoadModelFromMesh(mesh, false);
model.transform = MatrixIdentity(); // Set default transform matrix
model.material = LoadMaterialDefault(); // Load default material
// NOTE: By default each cube is mapped to one part of texture atlas // NOTE: By default each cube is mapped to one part of texture atlas
Texture2D texture = LoadTexture("resources/cubicmap_atlas.png"); // Load map texture Texture2D texture = LoadTexture("resources/cubicmap_atlas.png"); // Load map texture

View File

@ -43,7 +43,7 @@ int main()
skybox.material.shader.locs[LOC_MATRIX_VIEW] = GetShaderLocation(skybox.material.shader, "view"); skybox.material.shader.locs[LOC_MATRIX_VIEW] = GetShaderLocation(skybox.material.shader, "view");
// Then before rendering, configure the viewport to the actual screen dimensions // 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); MatrixTranspose(&proj);
SetShaderValueMatrix(skybox.material.shader, skyProjectionLoc, proj); SetShaderValueMatrix(skybox.material.shader, skyProjectionLoc, proj);