View Full Version : urgent .. rotate objects like sprites.
11-04-2003, 09:25 AM
this is urgent .. i need to write an expression assigned to rx,ry,rz to make my object faceing the Camera .. i though Constrain Aim will do it .. but its not.
11-04-2003, 07:17 PM
The aim-constraint orients towards the center of the camera. Sprites are oriented to be parallel to the image-plane. You can achieve this using following expression:
float $rot = `xform -q -ws -ro camera1`;
float $compensate = `xform -q -ws -ro groupOfOrientedObject`;
rx = $rot-$compensate;
ry = $rot-$compensate;
rz = $rot-$compensate;
The first line queries the world-orientation of the camera. The second one does this with the object one level higher in the hierarchy, than the oriented object is. The three last lines calculate the necessary angles.
If the object to align to the image-plane is on the top-hierarchy, you don't need the stuff with $compensate.
11-05-2003, 08:18 AM
:surprised am sure u didnt give yourself the time to think of it ..
11-05-2003, 07:00 PM
This expression is doing the right thing. You can take a look at the attached file. Perhaps you didn't give yourself enough time to understand the expression?!?
By the way, if you want an urgent answer, and somebody is posting, you shouldn't reply with such a defiant comment :thumbsdow Additionally it would be a good idea to explain your problem a bit further, since your elaboration on your problem is quite short.
P.S.: There is also a solution using orient-constraints, but I leave it to you to find this out :p
01-16-2006, 02:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2014, Jelsoft Enterprises Ltd.