FYI:
Before animation is started todd the rabbit is looking fine (screenshot 1) code:
SetVirtualResolution(1024,768)
SetScissor(0,0,0,0)
SetClearColor( 0,0,0 )
LoadObjectWithChildren(1,"todd.x")
SetObjectAnimationSpeed(1,10)
PlayObjectAnimation(1,"",20,219,1,0)
SetObjectCollisionMode(1,0)
InstanceObject(2,1)
SetObjectPosition(2,45,0,0)
SetObjectCollisionMode(1,1)
SetObjectCollisionMode(2,1)
do
// control the camera
if ( GetRawKeyState( 87 ) ) then MoveCameraLocalZ( 1, 0.2 )
if ( GetRawKeyState( 83 ) ) then MoveCameraLocalZ( 1, -0.2 )
if ( GetRawKeyState( 65 ) ) then MoveCameraLocalX( 1, -0.2 )
if ( GetRawKeyState( 68 ) ) then MoveCameraLocalX( 1, 0.2 )
if ( GetRawKeyState( 81 ) ) then MoveCameraLocalY( 1, -0.2 )
if ( GetRawKeyState( 69 ) ) then MoveCameraLocalY( 1, 0.2 )
if ( GetPointerPressed() )
startx# = GetPointerX()
starty# = GetPointerY()
angx# = GetCameraAngleX(1)
angy# = GetCameraAngleY(1)
pressed = 1
endif
if ( GetPointerState() = 1 )
fDiffX# = (GetPointerX() - startx#)/4.0
fDiffY# = (GetPointerY() - starty#)/4.0
newX# = angx# + fDiffY#
if ( newX# > 89 ) then newX# = 89
if ( newX# < -89 ) then newX# = -89
SetCameraRotation( 1, newX#, angy# + fDiffX#, 0 )
endif
DrawBox( 510,382,514,385, 0, 0, 0, 0, 1 )
DrawBox( 511,383,513,384, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 1 )
oldx# = GetCameraX(1)
oldy# = GetCameraY(1)
oldz# = GetCameraZ(1)
MoveCameraLocalZ(1, 100)
newx# = GetCameraX(1)
newy# = GetCameraY(1)
newz# = GetCameraZ(1)
MoveCameraLocalZ(1, -100)
hit = ObjectRayCast( 0, oldx#, oldy#, oldz#, newx#, newy#, newz# )
Print(hit)
Print(ScreenFPS())
sync()
loop
When stopping animations on all bones , the character freeze but it still looks wierd around the hand finger bones. ( screenshot 2 ) code:
for bn = 1 to GetObjectNumBones( objectid[objnumbers] )
SetObjectBoneCanAnimate( objectid[objnumbers] , GetObjectBoneByName( objectid[objnumbers] , GetObjectBoneName( objectid[objnumbers] , bn ) ) , 0 )
next bn
best regards Preben Eriksen,