Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Trouble with scripted camera position

Kayaker Magic
low carbonated footprint
Join date: 11 Sep 2008
Posts: 109
03-21-2009 22:03
I have an avatar sitting in a turret way off center from the root object in a vehicle. (OK, actually the avatar is actually wearing the turret) As the vehicle moves the turret swivels independently. I have successfully rotated the avatar and the turret, but the camera angle stays fixed relative to the vehicle, not the avatar or the turret.
I tried using llSetCameraParams to change the avatar’s view to follow the turret. There is no CAMERA_ROTATION, but I have a vector pointing in the direction the turret is facing and I can use that to set CAMERA_POSITION a few meters behind the avatar and this does the correct thing. HOWEVER, every time I call llSetCameraParams the camera view jumps foreword, back, the horizon rises then drops down again. I’ve got a splitting headache from watching it! How can I make this move more smoothly, or at least jump to one camera setting without bouncing up and down?
vector pos=llGetPos()+sitpos*dockrot;
llSetCameraParams([CAMERA_POSITION,pos-6.0*fwd+<0,0,4>]);
sitpos is the original sit position of the avatar, dockrot is the rotation of the whole vehicle, fwd is a unit vector pointing in the direction the avatar is facing.

Oh, and another thing: How come when the avatar unseats, the debug window pops up and says “Script trying to clear camera parameters but PERMISSION_CONTROL_CAMERA permission not set!” even though I was granted permission AND was able to control the camera. What gives with this? Does permission get taken away when the avatar unseats? Is there no good reason to call llClearCameraParams( ); after unseating? I can’t call it before the avatar unseats, unless there is an event that warns you before the unseating? That would be useful!
Kayaker Magic
low carbonated footprint
Join date: 11 Sep 2008
Posts: 109
03-22-2009 19:49
I found this script from Ben Linden:
http://secondlife.blogs.com/bulkupload/files/Camera_overide.lsl
That changes the default camera tracking behavior in an interesting way.
If I just drop this into my attached object, the camera does exactly what I want!
I don't understand why it works (I HATE THAT!) but for now I'm going to use it and figure out later why it works and why I wasn't able to get it working myself.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
03-22-2009 20:09
Glad we could help :p
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum