Update example
This commit is contained in:
parent
6cfece1e81
commit
03998f3963
5 changed files with 12926 additions and 54975 deletions
|
@ -16,11 +16,11 @@ func main() {
|
|||
camera.Up = rl.NewVector3(0.0, 1.0, 0.0)
|
||||
camera.Fovy = 45.0
|
||||
|
||||
dwarf := rl.LoadModel("dwarf.obj") // Load OBJ model
|
||||
texture := rl.LoadTexture("dwarf_diffuse.png") // Load model texture
|
||||
obj := rl.LoadModel("castle.obj") // Load OBJ model
|
||||
texture := rl.LoadTexture("castle_diffuse.png") // Load model texture
|
||||
|
||||
dwarf.Materials = make([]rl.Material, 1)
|
||||
dwarf.Materials[0].Maps[rl.MapDiffuse].Texture = texture // Set dwarf model diffuse texture
|
||||
obj.Materials = make([]rl.Material, 1)
|
||||
obj.Materials[0].Maps[rl.MapDiffuse].Texture = texture // Set castle model diffuse texture
|
||||
|
||||
position := rl.NewVector3(0.0, 0.0, 0.0) // Set model position
|
||||
|
||||
|
@ -33,21 +33,19 @@ func main() {
|
|||
|
||||
rl.BeginMode3D(camera)
|
||||
|
||||
rl.DrawModel(dwarf, position, 2.0, rl.White) // Draw 3d model with texture
|
||||
rl.DrawModel(obj, position, 2.0, rl.White) // Draw 3d model with texture
|
||||
|
||||
rl.DrawGrid(10, 1.0) // Draw a grid
|
||||
|
||||
rl.DrawGizmo(position) // Draw gizmo
|
||||
|
||||
rl.EndMode3D()
|
||||
|
||||
rl.DrawText("(c) Dwarf 3D model by David Moreno", screenWidth-200, screenHeight-20, 10, rl.Gray)
|
||||
rl.DrawText("(c) Castle 3D model by Alberto Cano", screenWidth-200, screenHeight-20, 10, rl.Gray)
|
||||
|
||||
rl.EndDrawing()
|
||||
}
|
||||
|
||||
rl.UnloadTexture(texture) // Unload texture
|
||||
rl.UnloadModel(dwarf) // Unload model
|
||||
rl.UnloadModel(obj) // Unload model
|
||||
|
||||
rl.CloseWindow()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue