summaryrefslogtreecommitdiffhomepage
path: root/examples/web/models/models_heightmap.c
diff options
context:
space:
mode:
authorRay <[email protected]>2017-10-20 14:09:09 +0200
committerRay <[email protected]>2017-10-20 14:09:09 +0200
commit7447deed40f1deabee659155a30b2d6aa454dafd (patch)
treeb63cb5b7bc1d850eff4697b2d1d04478ab800ae9 /examples/web/models/models_heightmap.c
parent1ad4b20e003468434b4e72317c26d04eb8f239ee (diff)
downloadraylib.com-7447deed40f1deabee659155a30b2d6aa454dafd.tar.gz
raylib.com-7447deed40f1deabee659155a30b2d6aa454dafd.zip
Updated examples for web
Diffstat (limited to 'examples/web/models/models_heightmap.c')
-rw-r--r--examples/web/models/models_heightmap.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/web/models/models_heightmap.c b/examples/web/models/models_heightmap.c
index bc51453..e9baa8b 100644
--- a/examples/web/models/models_heightmap.c
+++ b/examples/web/models/models_heightmap.c
@@ -5,7 +5,7 @@
* This example has been created using raylib 1.3 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
-* Copyright (c) 2015 Ramon Santamaria (@raysan5)
+* Copyright (c) 2017 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -45,9 +45,11 @@ int main()
Image image = LoadImage("resources/heightmap.png"); // Load heightmap image (RAM)
texture = LoadTextureFromImage(image); // Convert image to texture (VRAM)
- map = LoadHeightmap(image, (Vector3){ 16, 8, 16 }); // Load heightmap model with defined size
- map.material.texDiffuse = texture; // Set map diffuse texture
-
+
+ Mesh mesh = GenMeshHeightmap(image, (Vector3){ 16, 8, 16 }); // Generate heightmap mesh (RAM and VRAM)
+ Model model = LoadModelFromMesh(mesh); // Load model from generated mesh
+ model.material.maps[MAP_DIFFUSE].texture = texture; // Set map diffuse texture
+
UnloadImage(image); // Unload heightmap image from RAM, already uploaded to VRAM
SetCameraMode(camera, CAMERA_ORBITAL); // Set an orbital camera mode