Fix examples

This commit is contained in:
Milan Nikolic 2021-05-26 11:42:32 +02:00
parent c42d027833
commit ad07f2586d
No known key found for this signature in database
GPG key ID: 9229D0EAA3AA4E75
14 changed files with 5164 additions and 55024 deletions

View file

@ -22,12 +22,11 @@ func main() {
texture := rl.LoadTextureFromImage(image) // Convert image to texture (VRAM)
mesh := rl.GenMeshHeightmap(*image, rl.NewVector3(16, 8, 16)) // Generate heightmap mesh (RAM and VRAM)
//fmt.Printf("%+v\n", mesh)
model := rl.LoadModelFromMesh(mesh) // Load model from generated mesh
//fmt.Printf("%+v\n", model)
model.Materials = make([]rl.Material, 1)
model.Materials[0].Maps[rl.MapDiffuse].Texture = texture // Set map diffuse texture
mapPosition := rl.NewVector3(-8.0, 0.0, -8.0) // Set model position
model := rl.LoadModelFromMesh(mesh) // Load model from generated mesh
rl.SetMaterialTexture(model.Materials, rl.MapDiffuse, texture) // Set map diffuse texture
mapPosition := rl.NewVector3(-8.0, 0.0, -8.0) // Set model position
rl.UnloadImage(image) // Unload heightmap image from RAM, already uploaded to VRAM