Jump to content

Confusion with camera script functions


Melkanea
 Share

You are about to reply to a thread that has been inactive for 1866 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Creating an RLV trap, one that captures the view of the avatar and focuses it to the center of a TV screen. 

Im overwhelmed with these camera functions i have tried them all so far not what i want. 
http://wiki.secondlife.com/wiki/FollowCam

llSetCameraParams

    CAMERA_FOCUS, <vector>
    CAMERA_POSITION, <vector> 
    CAMERA_DISTANCE, float
    CAMERA_PITCH, degrees

Difference???? I got the permissions right, that was the easy part. 
All of these change the values of the others, like, if i set Position, Focus focuses anywhere, 
Pitch changes when i change the vector Z or the distance to the object. 
and most of all! if my avatar is not perfectly aligned with the axis of the TV or if the TV is rotated the avatar looks anywhere but at the center so i tried the following

=======
http://wiki.secondlife.com/wiki/LlGetCameraRot
//Camera Follower Script

This script moves my object out of bounds? wat? 
llGetCameraRot
llGetCameraPos
and the avatar still looks anywhere but the center of the screen

======
Then come these functions

llSetCameraEyeOffset
llSetCameraAtOffset

Suposedly when i sit the cam looks at the prim, NOT! 
llSetLinkCamera

Chuckles, i havent even gotten to the RLV part jet. http://wiki.secondlife.com/wiki/LSL_Protocol/RestrainedLoveAPI 
I get that i need to setup the cam on sit first and then restrict it.

WHELP! 

Link to comment
Share on other sites

If the avatar whose camera you want to control is sat on an object you can use llSetCameraAtOffset and llSetCameraEyeOffset to set that object's camera settings. The At offset is the difference between the position of the screen you want them to look at and the position of the object they are sat on. The Eye offset is the difference between the position where you want to place their camera and the position of the object they are sat on. The settings will be applied to the avatar's default camera when they sit on the object. If the avatar is camming away from their default camera, using Alt+Click with their mouse, for example, the settings will not be applied until they use Esc to reset their camera to the default settings. Note that these settings are persistent object settings – they still work even if the script that set them is removed from the object – and that they must be set before an avatar sits on the object, and that any changes to them will not take effect until the avatar stands and sits back down on the object.

If you use llSetCameraParams, you should use the CAMERA_FOCUS_LOCKED, TRUE and CAMERA_POSITION_LOCKED, TRUE rules to lock the camera to the coordinates you specify using CAMERA_FOCUS and CAMERA_POSITION. The same condition regarding the default camera position apply here, too.

You may want to investigate the RLV command @camunlock=n to prevent the avatar camming away from their default camera view, though I haven't ever used this myself, so I don't know it it overrides any scripted camera settings, in which case it probably wouldn't be any help.

  • Thanks 1
Link to comment
Share on other sites

9 hours ago, KT Kingsley said:

If you use llSetCameraParams, you should use the CAMERA_FOCUS_LOCKED, TRUE and CAMERA_POSITION_LOCKED, TRUE rules to lock the camera to the coordinates you specify using CAMERA_FOCUS and CAMERA_POSITION. The same condition regarding the default camera position apply here, too.

Dont forget to add the small detail that CAMERA_ACTIVE expects 1 and not TRUE to activate. lol

I managed to do it doing this

        key uuid=llGetKey();
        list position = llGetObjectDetails(uuid, ([ OBJECT_POS]));
        vector pos = llList2Vector(position,0);
        vector pos1 = pos + <0,-2.5,0.0> ;
        
        llSetCameraParams( [CAMERA_ACTIVE,1,
                            CAMERA_POSITION_LOCKED,TRUE,
                            CAMERA_FOCUS_LOCKED, TRUE, 
                            CAMERA_POSITION, pos1, 
                            CAMERA_DISTANCE, 2.5 ] );

But only when the TV is in a perfect angle specially when assigning pos1, im currently looking into how i can get the Rotation too
 

list rotated = llGetObjectDetails(uuid, ([OBJECT_ROT]));
        
      rotation rot = llList2Rot(rotated,0);
      

Edited by Melkanea
Link to comment
Share on other sites

1 minute ago, Melkanea said:

RLV is still confusing and now im more confused since http://wiki.secondlife.com/wiki/LSL_Protocol/RestrainedLoveAPI

You are not the only one. There was a split where one was not updating and the other was. The other set up a commercial MP with locked code.  You could try this. It is over bloated but you could direct the RLV to a satilite script with a cut down version of this. http://wiki.secondlife.com/wiki/FollowCam

Link to comment
Share on other sites

The angle brackets around the <n> are wrong. It should be @setcam_unlock=n. In the API documentation, <y/n> means you can use either y or n, but leave out the angle brackets which are there to indicate the beginning and the end of a list of possible options.

Edited by KT Kingsley
  • Haha 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1866 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...