Update C sources
This commit is contained in:
parent
02424e2e10
commit
bd6bf15356
53 changed files with 62247 additions and 9914 deletions
|
@ -1,6 +1,8 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
//"fmt"
|
||||
|
||||
"github.com/gen2brain/raylib-go/raylib"
|
||||
)
|
||||
|
||||
|
@ -20,10 +22,12 @@ 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)
|
||||
model := rl.LoadModelFromMesh(mesh) // Load model from generated mesh
|
||||
|
||||
model.Material.Maps[rl.MapDiffuse].Texture = texture // Set map diffuse texture
|
||||
mapPosition := rl.NewVector3(-8.0, 0.0, -8.0) // Set model position
|
||||
//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
|
||||
|
||||
rl.UnloadImage(image) // Unload heightmap image from RAM, already uploaded to VRAM
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue