Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llDetectedGrab around rotation

XArd Zond
Registered User
Join date: 10 Jun 2009
Posts: 7
10-18-2009 16:31
I have so far:

CODE

vector vecGrab = llDetectedGrab(0)/llGetCameraRot();
llSetPos(((<0.,vecGrab.y,vecGrab.x>)*0.2) * llGetCameraRot() + llGetPos());


This kinda works, just not properly when looking Up/Down on it.
Was wondering if anyone knew how to possibly complete this code.

Edit: Ignore the 0.2, that was just to scale down the result. (I think)
XArd Zond
Registered User
Join date: 10 Jun 2009
Posts: 7
10-19-2009 11:02
*Bump*

I'm sure someone knows.

Edit: The purpose of this is to move the object via clicking and dragging based on the rotation of the camera.
XArd Zond
Registered User
Join date: 10 Jun 2009
Posts: 7
10-19-2009 20:06
My above code seems somewhat silly in a way. But do note that I don't really have a clue what I'm doing.

After messing around a bit this is what I got now:

rotation rotBetween = llRotBetween(llRot2Fwd(llGetCameraRot()),<0.,0.,1.>;);
vector vecGrab = llDetectedGrab(0);
vector vecChange = (vecGrab * rotBetween);
llSetPos(vecChange + llGetPos());

Its almost what I want. Along the X and Y axis its fine. Just the Z axis, its giving a 'mirrored' value, not really opposite (Well kind of yes but never mind that).

Still hoping someone could pick up on this...

Edit: Ok, I've now noticed that it seems the rotBetween rotation rotates in the opposite rotation around the Y axis...