Posted: 21st Jun 2007 3:56
is there a command to rotate an object without changing where it was originally pointed, or is there a command to rotate towards a point?


thanks
Posted: 21st Jun 2007 5:20
is there a command to rotate an object without changing where it was originally pointed,

? That's impossible? Rotating an object will always change where it was pointed. "point object objnum, x, y, z" will point it at a certain point though.
Posted: 21st Jun 2007 5:27
no gill its not mate.

all objects have a zero limb, you can rotate that and it will still travel in the same direction it was always facing.

push up a tiny bit to see it goes forward.
then push left to rotate limb zero
push up again to see it still travels forward.
then push right and then up, it will now travel in the rotated angle.


+ Code Snippet
sync on : sync rate 60
make object cube 1,1
disable escapekey : while escapekey()=0


      if leftkey() = 1
      r = wrapvalue(r+1)
         ROTATE LIMB 1, 0,r,r,r
      endif

      if rightkey() = 1
         rr = wrapvalue(rr+1)
         ROTATE OBJECT 1,rr,rr,rr
      endif

      if upkey() = 1
      move object 1,1
      endif

sync : endwhile
delete object 1
end

Posted: 21st Jun 2007 18:59
thanks indi, this helps a lot. Just to clarify things i just have to use the ROTATE LIMB command for my game?
Posted: 21st Jun 2007 19:38
hallo friend....mmmmm I think...mmmmm you could do that if you move the pivot like that:


+ Code Snippet
autocam off
sync on
hide mouse

make object box 1,3,5,2
offset limb 1,0,0,0,30
make object sphere 2,2
position camera -50,50,-50
point camera 0,0,0

do
tur_n#=wrapvalue(tur_n#+0.3)
yrotate object 1,tur_n#
sync
loop