Hi,
I've a strange problem with this piece of code:
#constant CERCHIOPHY 100
#constant CERCHIOOBJ 110
set dir "media"
` set up the program
phy start
autocam off
sync on
sync rate 60
color backdrop 0
position camera 0, 0, -50
make light 1
set directional light 1, -5, -5, 5
load image "ball.jpg",1
make object sphere CERCHIOPHY,10
texture object CERCHIOPHY,1
position object CERCHIOPHY,0,5,0
phy make rigid body dynamic sphere CERCHIOPHY
phy set rigid body kinematic CERCHIOPHY,1
make object sphere CERCHIOOBJ,10
texture object CERCHIOOBJ,1
position object CERCHIOOBJ,0,5,0
` main program loop
phy update 0 : rem simulate
y# = 270
do
set cursor 0,0
if inkey$() = "a"
y#=wrapvalue(y#+0.15)
endif
if inkey$() = "s"
y#=wrapvalue(y#-0.15)
endif
rem rotate object CERCHIOPHY,0,y#,0
phy set rigid body kinematic rotation CERCHIOPHY,0,y#,0
` update simulation and screen
phy update 1 : rem fetch
position object CERCHIOOBJ,object position x(CERCHIOPHY),object position y(CERCHIOPHY)-10,object position z(CERCHIOPHY)
rotate object CERCHIOOBJ,object angle x(CERCHIOPHY),object angle y(CERCHIOPHY),object angle z(CERCHIOPHY)
phy update 0 : rem simulate
print "Y Fix:" + str$(wrapvalue(y#))
print "X Phy:" + str$(wrapvalue(object angle x(CERCHIOPHY)))
print "Y Phy:" + str$(wrapvalue(object angle y(CERCHIOPHY)))
print "Z Phy:" + str$(wrapvalue(object angle z(CERCHIOPHY)))
sync
center text screen width()/2,10,"FPS:"+str$(screen fps())+" Camera " + cam$
loop
I use this code because I've some dynamic mesh really complex, so I made a simpler mesh for dynamic object and complex object for visual. Then I hide the dynamic mesh and show complex mesh, positioned and oriented like dynamic.
When I try with this step of rotation (0.15) there are some values where kinematic rotation are not the same of object angle resulted.
I made an image that shows this situation:
Strange thing: if I try with another step like 0.10 or 0.20 I can't reproduce this problem.
For the sample I used a texture like this: