Author Topic: Rotating %obj with setTransform [Solved]  (Read 840 times)

How do I choose which direction an %obj is facing when I setTransform it?
« Last Edit: January 26, 2013, 07:24:34 PM by tommybricksetti »

The last 4 words in the transform specify the rotation direction and rotation magnitude. Just manipulate those.

The last 4 words in the transform specify the rotation direction and rotation magnitude. Just manipulate those.
4 words? I don't follow. I thought there were only 3 total.

Also, what I mean to do with this is make the %col player rotate to face me. So
Code: [Select]
setTransform(vectorAdd(%posA,%RelPos)); I have coded to move the player to where I am just shifted a bit left or right based on the relative position. What I want it to do is shift the player and face them toward me. i.e. if I setTransform them infront of me, rotate them to face the opposite direction I am.

4 words? I don't follow. I thought there were only 3 total.

Lol i told you what Port said, on RTB last night.

4 words? I don't follow. I thought there were only 3 total.
::setTransform(posX posY posZ ux uy uz rot)

(The ux,uy,uz,rot is an axis angle)

http://forum.blockland.us/index.php?topic=27230.0 <- To convert rotation
Example:
Code: [Select]
%position = "0 10 40";
%rotation = eulertoaxis("0 90 0");
%object.settransform(%position SPC %rotation);

:/ I just want to get the direction my player object is facing, and set %col's player object to face the opposite direction. So if I'm facing North I want to make %col face South, relative to me.