Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

rez object with rotation and position?

Robin Peel
Registered User
Join date: 8 Feb 2005
Posts: 163
03-22-2006 03:13
Good Day,
I tried to read the wiki about this, but I couldn't find anything that I understood.
Here is the code that I was trying to make. I just couldn't put in a rotation without an error.
Can somebody please help?
Thank you all

CODE

default
{
state_entry()
{
key id = llGetOwner();
llListen(0,"",id,"");
}
listen(integer channel,string name,key id,string message)
{
if (message == "out")
{
llRezObject("Goth Ship Ramp", llGetPos() + <-6,0,-4>, <2,0,0>, <0,0,180>);
}
}

changed(integer change)
{
if (change & 128)
{
llResetScript();
}
}
}
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
03-22-2006 04:19
<0,0,180> is not a rotation, it's a vector.

If you want to turn a rotation of 180 degrees around the Z axis into a rotation value, you want llEuler2Rot(<0,0,PI>;) instead.
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
03-22-2006 10:38
try something like this (untested)
CODE
vector Angle = <0,0,180>; //Enter a vector rotation
rotation quat; //your rotation converted to quat


default
{
state_entry()
{
vector eul = Angle; // in Euler form..
eul *= DEG_TO_RAD; //convert to radians...
rotation quat = llEuler2Rot( eul ); //convert to quaternion..

key id = llGetOwner();
llListen(0,"",id,"");
}
listen(integer channel,string name,key id,string message)
{
if (message == "out")
{
llRezObject("Goth Ship Ramp", llGetPos() + <-6,0,-4>, <2,0,0>, quat,42); //quat inserted
}
}

changed(integer change)
{
if (change & 128)
{
llResetScript();
}
}
}


-LW
Robin Peel
Registered User
Join date: 8 Feb 2005
Posts: 163
03-24-2006 09:08
Thank you very much. It works great.