Posted: 18th Jun 2007 20:32
it used to "reverse" when the object controls the camera... now it reverses where the mouse controls the camera. It's all because of the curvevalue command, and, I don't understand why

What I think is the problem is that the rotations of the object and mouse position is over 360, and set camera to follow automatically wraps the angle value... this is really quite confusing, and it's delaying my project. Any ideas? Need code? Want exe to try it? Just tell me if you do.

Thanks in advance,
Jim
Posted: 18th Jun 2007 20:42
I just position the camera at the player x,y,z
point camera to object directection
move camera back
move camera up
point camera to object orientation.

maybe not the most efficient way to do it but it works without wrap angles

another way is this (i didn't write it but it should work) ..

function positionCameraToObject(obj,thirdPerson)
position camera object position x(obj),object position y(obj),object position z(obj)
rotate camera object angle x(obj),object angle y(obj),object angle z(obj)
if thirdPerson=1
pitch camera down 10
move camera -30
endif
endfunction
Posted: 18th Jun 2007 21:03
GatorHex, thanks for that, but I'm using one single command for all camera movement and rotation. Set camera to follow. Set camera to follow requires unwrapped angles... and curvevalue wraps them, oddly.

I could just set it up your way then use curvevalue for smoothing... thanks, I'll give it a shot.

If anyone sees a quick way of fixing my problem as it is now, please post.

Thanks,
Jim
Posted: 18th Jun 2007 21:08
did you try ?

Return Float=WRAPVALUE(Angle Value)

it converts it to between 0-360
Posted: 18th Jun 2007 22:40
LOL!!!! I can't stop laughing at myself... curvevalue is for VALUES not angles.. curveangle is the correct term.... I'm so stupid sometimes... lol
Posted: 18th Jun 2007 22:43
wrapvalue caused problems too... because, one was returning a wrapped value, the camera's angle, and the other a position, the mouse x location... (still laughing by the way)

-Jim
Posted: 18th Jun 2007 22:55
Now the only problem I'm having is when I let go of the Alt key, it snaps back to 0 degrees... I want it to hold the angle, but it always reverts to 0... any ideas?

I could just use my old method that smooths it back to 0 degrees....

Thanks,
Jim