Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Help with camera

Xaq Zeno
Registered User
Join date: 30 May 2006
Posts: 9
05-02-2007 18:41
I'm trying to set my camera to the same position consitently

I've found the functions:
CODE

llGetCameraPos();
llGetCameraRot();


If I save the information from these functions, can I set the camera to the same
settings whenever I like?

There doesn't seem to be the functions:
CODE

llSetCameraPos();
llSetCAmeraRot();


I've found:
CODE

llSetCameraParams()


But I don't know if that is right.

I tried the following code:
CODE

vector v;

default {
state_entry() {
v = llGetCameraPos();
llOwnerSay("Camera is at: " + (string) v);
}

touch_start(integer num) {
llRequestPermissions(llGetOwner(), PERMISSION_CONTROL_CAMERA);
}

run_time_permissions(integer perm)
{
llOwnerSay("perm event:" + (string) perm);
if (perm & PERMISSION_TRACK_CAMERA) {
llOwnerSay("Got Track Perm - setting camera");
llSetCameraParams([CAMERA_POSITION, v]);
}
else if (perm & PERMISSION_CONTROL_CAMERA) {
llOwnerSay("Got Control Perm - setting camera");
llSetCameraParams([CAMERA_POSITION, v]);
}
}
}


But nothing happens (other than the expected output; the camera diesn't move.

Thanks
Xaq
Cryas Tokhes
Great Googley Moogley...
Join date: 8 Feb 2006
Posts: 124
05-11-2007 14:34
You may want to look into the PERMISSION_TRACK_CAMERA. This will allow you to track the position of the camera and rotation.

I may be way off, but it seems to be more in line with what you are looking for.
Lucius Nesterov
Registered User
Join date: 12 Oct 2006
Posts: 33
05-12-2007 03:57
I had a problem with the camera adjustment not reponding before, and it seemed to be that it was snapping back to a location near the avatar. Using the parameter: CAMERA_POSITION_LOCKED, TRUE seemed to help.

I agree with Cryas though, that you should probably get permissions before calling llGetCameraPos(). If you own the object calling the function then permissions are likely granted automatically, but it might not work for anyone else.