Add camera example
This commit is contained in:
parent
aa21811d38
commit
822d85c78c
3 changed files with 135 additions and 0 deletions
30
examples/blank.py
Normal file
30
examples/blank.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
from raylib.dynamic import raylib as rl, ffi
|
||||
from raylib.colors import *
|
||||
from camera import CameraFly
|
||||
|
||||
rl.SetTraceLogLevel(rl.LOG_ERROR)
|
||||
rl.SetConfigFlags(rl.FLAG_WINDOW_RESIZABLE)
|
||||
rl.InitWindow(512, 256, b'Test')
|
||||
rl.SetTargetFPS(60)
|
||||
rl.DisableCursor()
|
||||
|
||||
flycam = CameraFly()
|
||||
|
||||
|
||||
while not rl.WindowShouldClose():
|
||||
flycam.update()
|
||||
cam = flycam.get_camera()
|
||||
|
||||
rl.BeginDrawing()
|
||||
rl.ClearBackground((0, 200, 255, 255))
|
||||
rl.BeginMode3D(cam[0])
|
||||
|
||||
# NOTE(pebaz): For whatever reason, this can solve a percentage of artifacts
|
||||
rl.DrawGizmo([100000000, 100000000, 100000000])
|
||||
|
||||
rl.DrawGrid(32, 1)
|
||||
|
||||
rl.EndMode3D()
|
||||
rl.EndDrawing()
|
||||
|
||||
rl.CloseWindow()
|
Reference in a new issue