Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rez Sideways!

EyeDye Constantine
Registered User
Join date: 24 May 2008
Posts: 4
06-07-2008 11:49
When ever I try to rez an object via a rez box it always spawns sideways. How can I edit the script to spawn this object correctly? Here is a sample of the code I suspect is the problem:

llRezObject(bot, pos, ZERO_VECTOR, ZERO_ROTATION, 0);

.........................................................^^^^^^^^^^^^^


Can anyone help? Thanks.
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
06-07-2008 12:01
llRezObject(bot, pos, ZERO_VECTOR, rot, 0);
Using 'pos' and 'rot' you can rez it anywhere ( within 10m ) with any rotation.
_____________________
From Studio Dora
EyeDye Constantine
Registered User
Join date: 24 May 2008
Posts: 4
06-07-2008 12:25
what format does rotation go in? Max settings? Any examples of the code i need to insert? The object is sideways so i have to rotate it 90 degrees on one of the planes, which one would the be?

Thanks again for your help 8)
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
06-07-2008 12:46
From: EyeDye Constantine
what format does rotation go in? Max settings?

The rotation is a quaternion. LOL you know that one?
see http://www.lslwiki.net/lslwiki/wakka.php?wakka=rotation
Four floats, each one between -1 and +1.
From: EyeDye Constantine
The object is sideways so i have to rotate it 90 degrees on one of the planes, which one would the be?

Knowing nothing about how your object is orientated it is hard to say.
rot = < 0.70710678, 0.0, 0.0, 0.70710678 >; // 90 degrees around the X axis
rot = < 0.0, 0.70710678, 0.0, 0.70710678 >; // 90 degrees around the Y axis
rot = < 0.0, 0.0, 0.70710678, 0.70710678 >; // 90 degrees around the Z axis
rot = < -0.70710678, 0.0, 0.0, 0.70710678 >; // -90 degrees around the X axis
rot = < 0.0, -0.70710678, 0.0, 0.70710678 >; // -90 degrees around the Y axis
rot = < 0.0, 0.0, -0.70710678, 0.70710678 >; // -90 degrees around the Z axis
NOTE!
'pos' and 'rot' applies to the rezzed object, NOT the rezzing object
_____________________
From Studio Dora
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
06-07-2008 13:16
The LSL library has functions that make it pretty unnecessary to know the details about quaternions. See the bottom of http://www.lslwiki.net/lslwiki/wakka.php?wakka=rotation
Xhawkx Holden
Registered User
Join date: 1 Nov 2006
Posts: 86
06-08-2008 07:09
Here is a quick section of code to help ya out

vector xyzrot = <0,90,0>;
rotation rot = llEuler2Rot(xyzrot * DEG_TO_RAD);

llRezObject(bot, pos, ZERO_VECTOR, rot, 0);


Just set the xyzrot to the rotation you want the object to rez at.