# Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

### DLL Talk / EZ Rotate offset

Message
Posted: 10th Jun 2009 19:04
Hi again. Just a small question. I've been trying for a couple of days to get something simple (well I thought it would be). I want to be able to rotate my spacecraft towards a target/ co-ordinates but use the offset commands to use as a vector to move the object. All I'm trying to do right now is make the main object freely rotatable and have another object be placed on the offset coords to show it working.

Right now the main object seems to rotate one way and the sphere rotates another. Instead of staying in front. Does anyone know what I'm doing wrong?

Heres the code thats the problem (all unrelated code removed)

Make Object Box 1,1,1,2
Make Object Sphere 2,1,7,7

Do
MovePlayer()
Sync
Loop

Function MovePlayer()
EZro_SetEuler Object Angle X(1),Object Angle Y(1),Object Angle Z(1)
Ezro_SetPos Object Position X(1),Object Position Y(1),Object Position Z(1)
EZro_TurnTo 1100,-100,100,0.1
EZro_FindEuler
EZro_FindOffsetFromPoint 0,0,100
Position Object 2,EZro_GetOffsetX(),EZro_GetOffsetY(),EZro_GetOffsetZ()
Rotate Object 1,0,EZro_GetEulerY(),0
EndFunction

Thanks
Posted: 10th Jun 2009 20:06
I haven't tried your code, but I think you are using the wrong command for what you are trying to do. You are trying to find a 3d point from a given offset of an object according to it's orientation. The command that you are currently using is:

EZro_FindOffsetFromPoint

This command actually does the exact opposite. It tells you the offset amounts (according to an object's orientation) from a 3D point. Instead, try using:

EZro_FindPointFromOffset

I hope this helps!

Ron

a.k.a WOLF!
Posted: 10th Jun 2009 21:48 Edited at: 10th Jun 2009 21:48
Hmmm you're right, though I could've sworn I tried that yesterday! It works now. Thanks for that, I wasn't a million miles away from banging my head on the wall Tomorrow I can get things back underway again thanks.