Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rotating Cone Around Local Z?

Sue Stonebender
Piano Craftsman
Join date: 7 Jan 2005
Posts: 219
04-15-2006 12:13
I have a cone that I am rotating around the z-axis.

CODE
default
{
state_entry()
{
llTargetOmega(<0,0,2.5>, 2.5, 2.5);
}
}


Easy enough as long as I keep it oriented to 0 on all axes. As soon as I tilt it, it of course spins around the global z-axis. I've attempted to correct this using this ...

CODE
default
{
state_entry()
{
vector zAxis=llRot2Left(llGetRot());
llTargetOmega(<0,0,zAxis.z>, 2.5, 2.5);
}
}


... and also tried substituting Rot2Fwd and Rot2Up, which of course shows my utter lack of understanding on the right way to apply this, or if this is even the right way to go about fixing it :(

Willing to accept any and all public humiliation coming my way on this if someone is able to help me understand the error of my ways here.

Thanks a bunch,

Sue.
_____________________
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
04-15-2006 13:04
I think you want this:
CODE
default
{
state_entry()
{
vector zAxis=llRot2Up(llGetRot());
llTargetOmega(zAxis, 2.5, 2.5);
}
}
_____________________
-Seifert Surface
2G!tGLf 2nLt9cG
Sue Stonebender
Piano Craftsman
Join date: 7 Jan 2005
Posts: 219
04-15-2006 13:50
Perfect!

Thank you so very much for your help, Seifert. I appreciate it very much.

Sue.
_____________________