4
4
5
5
"""
6
6
7
+ import ctypes
8
+
7
9
from raypyc import *
8
10
from ctypes import *
9
11
10
- # Definitions
11
- # ------------------------------------------------------------------------------------
12
- MAX_BUILDINGS = 100
13
-
14
-
15
- # ------------------------------------------------------------------------------------
16
12
17
13
# ------------------------------------------------------------------------------------
18
14
# Program main entry point
@@ -34,12 +30,12 @@ def main():
34
30
35
31
# Load gltf model
36
32
model = load_model (b"resources/models/gltf/robot.glb" )
37
- animsCount = c_uint ()
38
- animIndex = int ( 0 )
39
- animCurrentFrame = int ( 0 )
40
- array = POINTER ()
41
- modelAnimations = load_model_animations (b"resources/models/gltf/robot.glb" , array )
42
- print ( array )
33
+ animsCount = c_uint (0 )
34
+ animIndex = 0
35
+ animCurrentFrame = 0
36
+
37
+ modelAnimations = load_model_animations (b"resources/models/gltf/robot.glb" , ctypes . pointer ( animsCount ) )
38
+
43
39
position = Vector3 (0.0 , 0.0 , 0.0 ) # Set model position
44
40
set_camera_mode (camera , CameraMode .CAMERA_FREE ) # Set free camera mode
45
41
@@ -55,7 +51,7 @@ def main():
55
51
if is_key_pressed (KeyboardKey .KEY_DOWN ): animIndex = (animIndex + animsCount - 1 ) % animsCount
56
52
57
53
# Update model animation
58
- anim = modelAnimations [int ( gg ) ]
54
+ anim = modelAnimations [animIndex ]
59
55
animCurrentFrame = (animCurrentFrame + 1 ) % anim .frameCount
60
56
update_model_animation (model , anim , animCurrentFrame )
61
57
@@ -69,7 +65,7 @@ def main():
69
65
70
66
clear_background (RAYWHITE )
71
67
72
- begin_mode_3d ()
68
+ begin_mode_3d (camera )
73
69
74
70
draw_model (model , position , 1.0 , WHITE ) # Draw animated model
75
71
draw_grid (10 , 1.0 )
0 commit comments