|
Post by sbdjazz on Mar 27, 2017 4:36:11 GMT
I recently went through a map script that works with iObjectLocation. I want to also get the orientation of the car to change the orientation of the car sprite, much like a compass.
|
|
|
Post by Power Supersport on Mar 27, 2017 15:39:15 GMT
That should do it...
OBJ_0 - Car, OBJ_22 - Sprite
Quaternion CarOrientation, SpriteOrientation; float y; void Main () { iObjectOrientation (OBJ_0, CarOrientation); iQuaternionToEulerAngles (CarOrientation, 0, y, 0); iQuaternionFromEulerAngles (SpriteOrientation, 0, 0, y, "xyz"); iObjectOrientationSet (OBJ_22, SpriteOrientation); }
|
|
|
Post by sbdjazz on Mar 29, 2017 14:38:32 GMT
Dude, it doesn't work and 3d rad crashes.
|
|
|
Post by Power Supersport on Mar 29, 2017 15:01:26 GMT
Oops, sorry... Didn't realize 3D Rad would crash... Just remembered, there's a demo project which has exactly what you want. It's called HeadingIndicator.3dr... Attachments:HeadingIndicator.3dr (198.35 KB)
|
|
|
Post by sbdjazz on Mar 29, 2017 18:23:06 GMT
Yeah it works now. Thanks!
|
|