Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Pulling My Hair Out Over Rotations

Al Bravo
Retired
Join date: 29 Jun 2004
Posts: 373
07-29-2004 08:31
Once again, rotations are killing me. Here is what I am trying to do:

I have prim. No matter how that prim is rotated and no matter where that prim is located, I want it to rez another prim at an incrementing offset from itself with the same rotation as itself.

So if prim1 is at <1, 1, 1> and my offset is <0.1, 0.0, 0.1>, I want prim2 to rez at <1.1, 1.0, 1.1> with the same rotation as prim1. And if prim1 is rotated 180 degrees around Z, I want prim2 to rez at <0.9, 1.0, 1.1>. Basically I just want to be able to rez a a stack of the same objects just up and to the right of the original prim regardless of its' orientation/position.

I know I am making this harder than it is. And I know the answer revolves somewhere around the llRot2Up() function. But my brain isn't wrapping around it.

HELP!
Lecktor Hannibal
YOUR MOM
Join date: 1 Jul 2004
Posts: 6,734
07-29-2004 09:39
Al, Have you upgraded your Solo Elevator ? I had a problem with it the other day. It operated fine, I rezzed on the runway and went up. When I got back went over to retrieve and could only take the Seat portion and not the platform portion which I believe is what holds the script ?? Also any progress on the halo project we had discussed last week ?
Lecktor
_____________________
YOUR MOM says, 'Come visit us at SC MKII http://secondcitizen.net '

From: Khamon Fate
Oh, Lecktor, you're terrible.

Bikers have more fun than people !
Apotheus Silverman
I write code.
Join date: 17 Nov 2003
Posts: 416
07-29-2004 11:23
I believe you are looking for something like this:

llRezObject("name", llGetPos() + (offset * llGetRot()), llGetRot(), ZERO_VECTOR, 0);

When you multiply a vector by a rotation, the return value is that vector rotated around <0,0,0> by the given rotation.

Unless I am remembering incorrectly, but I am pretty sure that's how it works.
_____________________
Apotheus Silverman
Shop SL on the web - SLExchange.com

Visit Abbotts Aerodrome for gobs of flying fun.
Al Bravo
Retired
Join date: 29 Jun 2004
Posts: 373
07-29-2004 12:11
Apoth,

Thanks - that is exactly what I needed. And.... I knew I was overthinking that.