Moopf Murray
Moopfmerising
Join date: 7 Jan 2004
Posts: 2,448
|
07-12-2004 12:41
OK, my brain's done here. I have an object where X points forward and I want that to rez and object relative to it (e.g. along it's local axis), in that if I give a rez position of <0,2,0> it will rez it in that position, relative to it's own rotation (so it will still be rezzed to the side). Am I making any sense here? Basically, I'm fine as long as I only want to rez it offset along X, e.g. <1,0,0>, with something like this: vector pos = llGetPos() + rot; It rezzes in the right position 1m in front of the parent object along the parent's X axis. But, I'm obviously being a rotation dufus here as I can't get anything to work no matter what the rez position is. Can somebody please put me out of my misery?  Rotations aren't my strong point 
|
Wednesday Grimm
Ex Libris
Join date: 9 Jan 2003
Posts: 934
|
07-12-2004 12:51
You want something like: vector pos; vector offset = <1, 0, 0>; pos = offset; pos = pos * llGetRot(); (or maybe llGetRot() * pos, I can never remember, one will compile, the other won't). pos = pos + llGetPos(); llRezObject (..., pos, ...);
That is to say, you want to rotate the offset from the parent object (the offset mind you, not the world position) by the parent's rotation.
_____________________
Sarcasm meter: 0 |-----------------------*-| 10 Rating: Awww Jeeze!
|
Moopf Murray
Moopfmerising
Join date: 7 Jan 2004
Posts: 2,448
|
07-12-2004 12:54
Bang on Wednesday, ta 
|