Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

camera follower rotation help

Uriel Blackadder
Registered User
Join date: 21 Aug 2007
Posts: 1
10-08-2007 13:58
i've made an object tha follows my camera using ibm's camera follower script. currently, the object focuses on my own avatar. the documentation at the bottom of the script suggests that if i want the object to turn towards the camera's focus, i have to use llGetCameraRot, but is vague in it's description of how to do so, and the lsl wiki documentation did not have the info i needed. any suggestions on where i should put llGetCameraRot to make the object focus on the same direction as my camera?

here is the relevant portion of the script

{
// Here the timer uses llMoveToTarget() which simply moves the
// object to wherever the owner's camera is, and about 1 meter
// above (as to not obtruct the owner's view. The owner will
// not be able to see the object under most circumstances, so if
// the owner wants to get rid of the object, they must first say
// "stop" in chat to make the object stop moving. Then they can
// click on the object a lot easier to delete or take.
llMoveToTarget(llGetCameraPos() + <.0, .0, -1.0>, 0.20);

// Since the object looks a bit awkward only moving to position and
// not rotating properly, we call a simple sensor looking for the
// owner's current position.
llSensor("", llGetOwner(), AGENT, 96, PI);
}

sensor(integer num_detected)
{
// After we get the owner's position, we'll have the object just
// look at the owner using it's forward axis. This gives a nice
// effect. If you wanted to track the owners actual camera rotations
// then you would have to use llGetCameraRot() and make the correct
// calculations. We do it this way for simplicity.
llLookAt(llDetectedPos(0), 0.32, 0.32);
}
}
Bloodsong Termagant
Manic Artist
Join date: 22 Jan 2007
Posts: 615
10-10-2007 08:25
hmm...

its not


rotation Rot = llGetCameraRot();

llSetRot(Rot);

?


as far as i know, the camera uses the same axes as the rest of the world. unless they meant their little movie camera object had a y = 90 degree rotation or something. as long as your root prim is zeroed when you build, it should work fine.

i think???

--oh, where to put it. well, that's easy. put it where the llSensor bit is, in the timer event, and get rid of the sensor event.
_____________________
Why Johnny Can't Rotate:
http://forums.secondlife.com/showthread.php?t=94705