Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

More llRezObject Problems

Corster Mousehold
The other white meat
Join date: 18 Jan 2005
Posts: 23
02-10-2005 07:33
I have a single prim flat game board that lies parallel with the ground with points where a user can touch. For touch points I have created a multi-prim 'touch matrix' that needs to be rezzed in and out depending on what is going on in the game (either the whole touch matrix is there or the whole thing is not.. no partials) When rezzing it in at it's default create position it works fine, but if the game board is rotated, the matrix is skewed to the left and the right, but the rotation is ok. I've tried using the code from a previous post to no avail. Something like:

llRezObject("Object Name", lLGetPos() + (<1, 2, 1> * llGetRot()), ZERO_VECTOR, llGetRot(), 0);

supposedly the ";(<1, 2, 1> * llGetRot())" is the key to getting the exact position and rotation relative to the rezzing prim, but it is always shifted no matter what I do.

Suggestions?

-cor-
Rhombur Volos
King of Scripture & Kebab
Join date: 6 Oct 2004
Posts: 102
02-10-2005 08:07
If you rez from a child object, the function seems to use local coordinates for position. This has confused me before.
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
02-10-2005 10:08
llRezObject("Object Name", llGetPos() + (<1, 2, 1> / llGetRot()), ZERO_VECTOR, llGetRot(), 0);
However, occasionally I have problems with the command working on the proper coordinate system. At times like that, my dumb solution to the problem seems to work.

Rhom: In my experiences, child prims rezzing objects seems to rez them from the child okay if I use llRezObject, if the rez position is based off llGetPos() (which returns the child position for all but avatar attachments). However, I'm not sure what llRezAtRoot would do.
_____________________
---
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
02-11-2005 07:27
I'm doing something similar. Rather than continually rez and unrez the touch points, I opted to have every touch point be a prim, and toggle their transparency. Then again, this was necessary because the touch points also corresponded with where game pieces went, so I needed something to texture and such. Anyway, if I were so inclined (I haven't bothered yet), I could turn off the touchability of the grid by sending a link message that put them into a state without a touch event. In practice, I just ignore touch events that are out of turn. Maybe this will be a simpler solution for you?
Corster Mousehold
The other white meat
Join date: 18 Jan 2005
Posts: 23
02-11-2005 13:33
The problem with doing it that way is that I will have a loose object that will be using the flat gameboard prim and the matrix will get in the way. I can't link the matrix to the gameboard and make it phantom because once linked the martix loses it's 'phantom' status and becomes an obstacle to all physical objects.


Oh yeah, btw, I've tried:

llRezObject("Object Name", llGetPos() + (<1, 2, 1> / llGetRot()), ZERO_VECTOR, llGetRot(), 0);

...and I still get a problem with the matrix rezzing shifted after I rotate the source rezzing prim. :(

-cor-
Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
02-12-2005 05:57
From: Corster Mousehold
The problem with doing it that way is that I will have a loose object that will be using the flat gameboard prim and the matrix will get in the way. I can't link the matrix to the gameboard and make it phantom because once linked the martix loses it's 'phantom' status and becomes an obstacle to all physical objects.


Oh yeah, btw, I've tried:

llRezObject("Object Name", llGetPos() + (<1, 2, 1> / llGetRot()), ZERO_VECTOR, llGetRot(), 0);

...and I still get a problem with the matrix rezzing shifted after I rotate the source rezzing prim. :(

-cor-

Move the parenthesis over. The / llGetRot() should be outside of them, and the Pos and vector should be added together first.
_____________________
</sarcasm>
Tread Whiplash
Crazy Crafter
Join date: 25 Dec 2004
Posts: 291
Divide??
02-12-2005 12:37
Sorry, maybe I missed something... why "/ llGetRot()"? Usually when I'm trying to correct for an unknown rotation of the parent object from its "base" position, I use "* llGetRot()"...

Example from my board-game code; which I know works:
(I apologize that its a little messy)
CODE

vector locOffset = <-0.055,1.531,1.526>; //Board Corner Offset at 0 rotation.

//Reduce the offset in the y direction by the number of tiles we are over,
//plus 1/2 if on an "odd" row (0-based).
locOffset.y -= ((tileCol * TILE_H_SPACING) +
((tileRow % 2) * TILE_H_SPACING * 0.5) );

//Reduce the offset in the z direction by the number of rows from the top we are.
locOffset.z -= (tileRow * TILE_V_SPACING);

//take Rotation into Account.
locOffset *= llGetRot();

//Convert to final world-space coordinates...
vector finalPosition = llGetPos() + locOffset;