Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Copy one object's rotation to another... ?

David Czukor
Prole
Join date: 8 Jun 2004
Posts: 16
07-12-2004 07:07
I am having a hard time with something I thought should be simple. I want to take the in-world, rotated appearance of an object and pass it to another object so that it can take on the same rotatation. Passing and copying the value from the sender's llGetRot() to the receiver's llSetRot() doesn't work. Neither does multiplying the receiver's llGetRot() by the sender's (w/ either order of params). The receiver winds up w/ a very bizzare rotation with its faces flipped completely differently from the sender.

Clearly, there's something I'm not understanding. Ideas?

Thanks,
-- D
Wednesday Grimm
Ex Libris
Join date: 9 Jan 2003
Posts: 934
07-12-2004 08:06
What you're describing should work, getting the rotation from one object with llGetRot(), then plugging that value in to another object's llSetRot() should make them both have th same rotation.

These are the things I would check frist:

1) Is the rotation being passed right? If you llSay the rotation in the first object when you get it, and llSay the rotation in the second object when you set it, are they the same?

2) If you set the rotation of both objects to ZERO_ROTATION, either in a script, or by setting the rot values in the edit window to 0, are they oriented like you'd expect? If not, the root primitive of one of the objects does not face "forward" for the object, and you'll have to multiply the rotation by some offset value.

(Oh, these scripts they are on the root primitives of both objects, yes?)
_____________________
Sarcasm meter:
0 |-----------------------*-| 10
Rating: Awww Jeeze!
Montecristo Yellowknife
Junior Member
Join date: 14 Jun 2004
Posts: 1
hmmm
07-12-2004 09:12
Hey,

I am not sure what your trying to do, but I have a ton of experience in this. Contact me ingame if you want and I can explain to you how to do it. I wrote a plotter that spawns railing connecting the ends together. So I had to do the same thing already. I'll help ya out.

Montecristo yellowknife.
David Czukor
Prole
Join date: 8 Jun 2004
Posts: 16
07-12-2004 09:47
Thank you, Wednesday.

Yes, the passed and retrieved values are the same, which is what led me to think the in-world appearance of the items would be the same, but it isn't.

Your second suggestion is telling... The two objects do NOT have the same appearance when setting ZERO_ROTATION in the Object editor. It looks like I have to calculate the difference and include that when setting the receiver's rotation.

I still think that if two things are set to the same global rotation, they should point the same way. It shouldn't depend on local orientation of each object, but that's just my feeble understanding of rotations!

I think I'll take Montecristo up on his offer of some personal help.

Thank you both,
-- D