|
Mevo Syaka
Ganja Guru
Join date: 12 Dec 2006
Posts: 33
|
09-10-2007 09:12
Hi peeps, I was wondering if it's possible to rez an object out of an attachment with it's position relative to the avatars direction? The idea is so that the rezzed object appears in front of my avatar no matter which direction im standing in.
Any help is very much appreciated!
Thanks.
|
|
Haruki Watanabe
llSLCrash(void);
Join date: 28 Mar 2007
Posts: 434
|
09-10-2007 09:24
Well, when your AV wears the object on the belly, everytime the AV is turned, the faces of the attachment turn accordingly. Therefore you should be able to read the x,y,z-coordinates and rez the next object relative to them... (didn't try that, but I guess this should work... 
|
|
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
|
09-10-2007 09:38
There are a few commands that might help. But first off understanding that an avatar with 0 rotation is situated facing along the X axis helps me with these things. So knowing that I can see that <1,0,0> would be 1 meter in front of my avatar if it was at 0 rotation. Then I should be able to apply my current rotation to it to translate it to face my 'actual' forward.
So maybe something like this (warning, I suck at rotations so consider this the 'gist' and not necessarily scripture! lol):
integer ONE_FORWARD = 1; integer ONE_LEFT = 1; integer ONE_RIGHT = 1;
rotation AvatarCurrentRotation = llGetRot();
//made up offset, one meter forward, one to the left, and two up. vector rawOffsetWithNoRotation = <ONE_FORWARD, ONE_LEFT, 2*ONE_UP>;
vector actualOffsetThatShouldWork = rawOffsetWithNoRotation * AvatarCurrentRotation;
|
|
Mevo Syaka
Ganja Guru
Join date: 12 Dec 2006
Posts: 33
|
09-10-2007 09:52
Thanks for the help! Im not very good with rotations either, looks like im gonna have to fiddle about until it works. lol.
Thats definatly helped a lot though, thanks!
|
|
Mevo Syaka
Ganja Guru
Join date: 12 Dec 2006
Posts: 33
|
09-10-2007 10:29
I finally got the problem solved thanks to help from Bartholomew DeCuir. This is for anyone who maybe having the same problem. This rezzes the object in front of the avatar with the correct rotation: llRezObject("Object",llGetPos() + llRot2Fwd(llGetRot()),ZERO_VECTOR,llGetRot(),0);
|