Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Camera Control

Heratiki Turnbull
Juggalo Ninja Master
Join date: 2 Mar 2005
Posts: 81
03-27-2006 10:31
Ok... I have the basics of the Camera Control down pat but say I want to have the camera create a static look... Ok so you ask... WTH do you mean... Well I'm trying to get it so that when you hop on a pose ball no matter where it's at or what it's rotation is have it basically look exactly the same... Centered in on the AV with the entire AV Showing with about a meter on top and bottom... Basically a centered shot... I'm trying to create a newb friendly photobooth... So to get those great shots you merely need to press ESC instead of having to setup the shot yourself... Would love any help I can get... And may even pay...

Heratiki Turnbull
_____________________
"Don't place faith in human beings
human beings are unreliable things
don't place faith in human beings
human beings or butterfly's wings

You can't place faith in a new regime
that fascist faith will kill you
a hurricane triggered by a butterfly's wings
your conspirators betray you"

MOLG - Butterfly Wings
Moriash Moreau
Registered User
Join date: 1 Jan 2005
Posts: 39
Stick with the old camera controls
03-27-2006 12:04
Sounds like you'd be better off using the old fashioned, pre v1.9 camera commands: llSetCameraEyeOffset and llSetCameraAtOffset. Those only work when the avatar sits on the object (which is what you're doing anyway), and they don't require permissions (unlike the new v1.9 camera controls). Here's a basic example. You'll likely need to tinker with the offset vectors (all are relative to the root prim the script is placed inside) a bit to get the exact distance from and framing around the avatar in your booth, but this should give you a good start. The nice thing here is if you rotate the pose ball, the camera will automatically rotate with it, without the need for calculations of rotation and distance vectors.

CODE

default
{
state_entry()
{
// The camera is located 4m in front of the pose ball, and 1m above it.
llSetCameraEyeOffset(<4, 0, 1>);
// The camera is focused on a point 1m above the pose ball,
// and thus is facing back towards the avatar sitting on it.
llSetCameraAtOffset(<0, 0, 1>);
}
}
Heratiki Turnbull
Juggalo Ninja Master
Join date: 2 Mar 2005
Posts: 81
03-28-2006 08:08
Thanx I'll give that a definite try... Question though... Will I have to change the values whenever the Pose ball is rotated around... But I'll definitely give that a try... Thank you again...

Heratiki
_____________________
"Don't place faith in human beings
human beings are unreliable things
don't place faith in human beings
human beings or butterfly's wings

You can't place faith in a new regime
that fascist faith will kill you
a hurricane triggered by a butterfly's wings
your conspirators betray you"

MOLG - Butterfly Wings
Moriash Moreau
Registered User
Join date: 1 Jan 2005
Posts: 39
03-29-2006 07:50
Yeah, the camera will rotate with the poseball. Depending on the pose, it could be easier to change the sit rotation in the sit animation script, and leave the poseball itself unrotated. But I suppose that defeats the purpose of using poseballs!

If you don't want to have the camera rotate with the pose ball, you could look into the v1.9 camera control functions, and set the CAMERA_FOCUS and CAMERA_POSITION variables. (You'll need to work out the permissions and such to activate when an avatar sits on the pose ball, but you already know that.) The CAMERA_POSITION and CAMERA_FOCUS work off region coordinates (thus the llGetPos() adder). The snippet below will locate the camera 4m in the region's absolute +X direction (East) and 1m above the pose ball. And the camera will look back at a point 1m above the pose ball. This will look identical to what the old style script above does, but it will set the camera in the same position no matter what the rotation of the poseball is.

CODE

llSetCameraParams([
CAMERA_ACTIVE, TRUE, // Yes, we want to control the camera.
CAMERA_FOCUS, llGetPos() + <0,0,1>, // The camera is focused on this point.
CAMERA_FOCUS_LOCKED, TRUE, // And doesn't change focus.
CAMERA_POSITION, llGetPos() + <4,0,1>, // The camera is located at this point.
CAMERA_POSITION_LOCKED, TRUE // And doesn't change position.
]);


You'll make your life easier if you setup your photo booth in an east-west or north-south orientation, so you don't have to do rotation calculations to figure out the offset vector for the CAMERA_POSITION. (I'm not even going to attempt to explain that. Rotation calcs give me the willies.) Good luck!
Heratiki Turnbull
Juggalo Ninja Master
Join date: 2 Mar 2005
Posts: 81
03-30-2006 05:33
Yeah currently it works great without all the Rotation calculations... 2 days ago I attempted to sit down and work out the calcs myself and I think my brain went into melt down... I just started babbling non-sensical words... It was horrible at the very least... Anyways... The old school method seems to work pretty well... If you get a chance IM me in world and I'll show ya... Thanx again...

Heratik Turnbull
_____________________
"Don't place faith in human beings
human beings are unreliable things
don't place faith in human beings
human beings or butterfly's wings

You can't place faith in a new regime
that fascist faith will kill you
a hurricane triggered by a butterfly's wings
your conspirators betray you"

MOLG - Butterfly Wings