Initial commit
This commit is contained in:
commit
d7ff68b487
196 changed files with 286314 additions and 0 deletions
42
examples/core/3d_mode/main.go
Normal file
42
examples/core/3d_mode/main.go
Normal file
|
@ -0,0 +1,42 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/gen2brain/raylib-go/raylib"
|
||||
)
|
||||
|
||||
func main() {
|
||||
raylib.InitWindow(800, 450, "raylib [core] example - 3d mode")
|
||||
|
||||
camera := raylib.Camera{}
|
||||
camera.Position = raylib.NewVector3(5.0, 10.0, 10.0)
|
||||
camera.Target = raylib.NewVector3(0.0, 0.0, 0.0)
|
||||
camera.Up = raylib.NewVector3(0.0, 1.0, 0.0)
|
||||
camera.Fovy = 45.0
|
||||
|
||||
cubePosition := raylib.NewVector3(0.0, 0.0, 0.0)
|
||||
|
||||
raylib.SetTargetFPS(60)
|
||||
|
||||
for !raylib.WindowShouldClose() {
|
||||
raylib.BeginDrawing()
|
||||
|
||||
raylib.ClearBackground(raylib.RayWhite)
|
||||
|
||||
raylib.Begin3dMode(camera)
|
||||
|
||||
raylib.DrawCube(cubePosition, 2.0, 2.0, 2.0, raylib.Red)
|
||||
raylib.DrawCubeWires(cubePosition, 2.0, 2.0, 2.0, raylib.Maroon)
|
||||
|
||||
raylib.DrawGrid(10, 1.0)
|
||||
|
||||
raylib.End3dMode()
|
||||
|
||||
raylib.DrawText("Welcome to the third dimension!", 10, 40, 20, raylib.DarkGray)
|
||||
|
||||
raylib.DrawFPS(10, 10)
|
||||
|
||||
raylib.EndDrawing()
|
||||
}
|
||||
|
||||
raylib.CloseWindow()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue