; GetBone Example ; --------------- Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() PositionEntity camera,0,2,-6 RotateEntity camera,12,0,0 light=CreateLight() RotateEntity light,45,45,0 ; A grassy paddock for the fox to roam ground=CreatePlane() EntityTexture ground,LoadTexture("media/MossyGround.BMP") ; Load the rigged fox; its skinned mesh is driven by a bone skeleton fox=LoadAnimMesh("../../../samples/glTF/assets/Fox/Fox.glb") If fox=0 Then RuntimeError "Could not load Fox.glb: "+ModelLoadError() ; Shrink the fox to game scale (the file is modelled about 100 units tall) FitMesh fox,-0.8,0,-0.8,1.6,1.6,1.6,True ; Start the fox walking walk=FindAnimSeq(fox,"Walk") Animate fox,1,1,walk bones=CountBones(fox) index=1 ; A glowing marker that rides the selected bone marker=CreateSphere(8) ScaleEntity marker,0.06,0.06,0.06 EntityColor marker,255,80,80 EntityFX marker,1 While Not KeyDown(1) ; Step through the skeleton with [ and ] If KeyHit(26) And index>1 Then index=index-1 If KeyHit(27) And index