Difference between revisions of "Camera Commands"

From Catznip
Jump to navigation Jump to search
({{RLVaCommand|setcam_focus|{{RLVaOptional|;distance[;direction]}}|{{RLVaCommandType|force}}}})
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
Camera manipulation commands follow the same concept as {{RLVaCommand|setenv||}} where a single object can exclusively lock control of the camera.
+
Camera manipulation commands  
  
  
Line 6: Line 6:
  
 
==Setting Camera values==
 
==Setting Camera values==
==={{RLVaCommand|setcam||{{RLVaCommandType|ny}}}}===
+
==={{RLVaCommandHeader|setcam||{{RLVaCommandType|ny}}}}===
  
Only one object can hold this behaviour at a given time (debug output will show "locked" as the failure message on subsequent attempts). When an object holds the lock, all camera commands from all other objects will be ignored; when the object releases the lock all other camera behaviours will be restored.
+
Only one object can hold this behaviour at a given time following the same concept as {{RLVaCommand|setenv||}} where a single object can exclusively lock control. Debug output will show "locked" as the failure message on subsequent attempts.  
  
==={{RLVaCommand|setcam_eyeoffset|{{RLVaOptional|{{RLVaParameter|vector3}}}}|{{RLVaCommandType|force}}}}===
+
When an object holds the lock, all camera commands from all other objects will be ignored; when the object releases the lock all other camera behaviours will be restored.
Changes the default camera offset by manipulating the '''CameraOffsetRearView''' debug setting.  
 
  
==={{RLVaCommand|setcam_focus|<agent{{!}}object{{!}}location>{{RLVaOptional|;distance[;direction]}}|{{RLVaCommandType|force}}}}===
+
----
 +
 
 +
==={{RLVaCommandHeader|setcam_eyeoffset|{{RLVaOptional|:{{RLVaParameter|vector3}}}}|{{RLVaCommandType|force}}}}===
 +
Changes the default camera offset in the same way as changing the '''CameraOffsetRearView''' debug setting (the debug setting is not changed).
 +
 
 +
----
 +
 
 +
==={{RLVaCommandHeader|setcam_focus|<agent{{!}}object{{!}}position>{{RLVaOptional|;{{RLVaParameter|distance}};{{RLVaParameter|direction}}}}|{{RLVaCommandType|force}}}}===
  
 
Moves the camera and focus to the specified position (user can still change focus afterwards).
 
Moves the camera and focus to the specified position (user can still change focus afterwards).
  
* <span class="rlvacmd"><agent{{!}}object{{!}}location></span> UUID of the object or agent to focus on or a location vector (in region coordinates)
+
* <span class="rlvacmd">{{RLVaParameter|agent}}{{!}}{{RLVaParameter|object}}{{!}}{{RLVaParameter|position}}</span> UUID of the object OR agent to focus on OR a position vector (in region coordinates)
* <span class="rlvacmd"><span title="optional" class="opt"><distance></span></span> optional (calculated based on the object's size if omitted) distance of the camera to the focus
+
* <span class="rlvacmd">{{RLVaOptional|{{RLVaParameter|distance}}}}</span> optional (calculated based on the object's size if omitted) distance of the camera to the focus
* <span class="rlvacmd"><span title="optional" class="opt"><direction></span></span> optional (calculated on current camera if omitted) normalized directional vector
+
* <span class="rlvacmd"><span title="optional" class="opt">{{RLVaOptional|{{RLVaParameter|direction}}}}</span></span> optional (calculated on current camera if omitted) normalized directional vector
 +
 
 +
Focus on an agent(get your own UUID) from 20m away with your previous camera orientation.
 +
<code>
 +
{{RLVaCommand|setcam_focus|:{{RLVaParameter|uuid}};20;|{{RLVaCommandType|force}}}}
 +
</code>
 +
 
 +
Focus on an object (rez a prim for this and grab its UUID), this will cause the camera to look at the plywood cube (filling the screen) along negative X.
 +
<code>
 +
{{RLVaCommand|setcam_focus|:{{RLVaParameter|uuid}};;1/0/0|{{RLVaCommandType|force}}}}
 +
</code>
 +
Now resize the prim (20x20x20m) and retry the command. You'll note that the plywood cube still fills the screen. If you omit the distance RLVa will calculate it based on scale so the object is always fully in view.
 +
 
 +
Focus on an Location.Move the camera to <128, 128, 75> looking down at the land.
 +
<code>
 +
{{RLVaCommand|setcam_focus|:128/128/75;;0/0/1|{{RLVaCommandType|force}}}}
 +
</code>
 +
 
 +
 
 +
----
 +
 
 +
==={{RLVaCommandHeader|setcam_focusoffset|{{RLVaOptional|:{{RLVaParameter|vector3}}}}|{{RLVaCommandType|force}}}}===
 +
Changes the default camera focus offset in the same way as changing the '''FocusOffsetRearView''' debug setting (the debug setting is not changed).
 +
 
 +
----
 +
 
 +
==={{RLVaCommandHeader|setcam_fov|:{{RLVaParameter|angle}}|{{RLVaCommandType|force}}}}===
 +
Changes the camera's vertical field of view to the specified value (angle in radians).
  
==={{RLVaCommand|setcam_focusoffset|{{RLVaOptional|{{RLVaParameter|vector3}}}}|{{RLVaCommandType|force}}}}===
+
----
Changes the default camera focus offset by manipulating the '''FocusOffsetRearView''' debug setting.
 
  
==={{RLVaCommand|setcam_fov||}}===
+
==={{RLVaCommandHeader|setcam_fovmin|:{{RLVaParameter|angle}}|{{RLVaCommandType|ny}}}}===
  
 +
Limit the user's fov angle to a minimum value (angle in radians). Setting {{RLVaCommand|setcam_fovmin||}} & {{RLVaCommand|setcam_fovmax||}} to the same value locks the value.
  
==={{RLVaCommand|setcam_fovmin||}}===
+
Set the minimum FOV to 45°
 +
<code>{{RLVaCommand|setcam_fovmin|0.780|{{RLVaCommandType|n}}}}</code>
  
 +
----
  
==={{RLVaCommand|setcam_fovmax||}}===
+
==={{RLVaCommandHeader|setcam_fovmax|:{{RLVaParameter|angle}}|{{RLVaCommandType|ny}}}}===
 +
Limit the user's fov angle to a maximum value (angle in radians). Setting {{RLVaCommand|setcam_fovmin||}} & {{RLVaCommand|setcam_fovmax||}} to the same value locks the value.
  
 +
set the maximum FOV to 90°
 +
<code>{{RLVaCommand|setcam_fovmax|:1.57|{{RLVaCommandType|n}}}}</code>
  
==={{RLVaCommand|setcam_unlock||}}===
+
----
  
 +
==={{RLVaCommandHeader|setcam_unlock||{{RLVaCommandType|ny}}}}===
 +
Force the camera to remain focused on the user's avatar at all times, in effect, making them the fixed centre of the world. Formerly RLV command {{RLVaCommand|camunlock||}}.
  
 +
'''Possibly change: currently still allows free camera movement when controlled through by LSL, needs handling and blocking as well?'''
  
  
==Camera Control Examples==
 
  
  
 +
==Camera Control Examples==
  
 
===Change 3rd person camera position & viewpoint===
 
===Change 3rd person camera position & viewpoint===
Basic camera position (as detailed in [http://pennycow.blogspot.be/2011/07/matter-of-perspective.html Penny Patton's A Matter of perspective]) can be done via the {{RLVaCommand|setcam_eyeoffset||}} and {{RLVaCommand|setcam_focusoffset||}} commands which adjust the '''CameraOffsetRearView''' and '''FocusOffsetRearView''' debug settings respectively.
+
Basic camera position (as detailed in [http://pennycow.blogspot.be/2011/07/matter-of-perspective.html Penny Patton's A Matter of perspective]) can be done via the {{RLVaCommand|setcam_eyeoffset||}} and {{RLVaCommand|setcam_focusoffset||}} commands which affect the camera in the same way as the '''CameraOffsetRearView''' and '''FocusOffsetRearView''' debug settings.
  
 
NOTE: if you're using these without {{RLVaCommand|setcam||}} then please restore the default manually after you're done; otherwise {{RLVaCommand|setcam||y}} will take care of cleaning up and restore things back to the user's default
 
NOTE: if you're using these without {{RLVaCommand|setcam||}} then please restore the default manually after you're done; otherwise {{RLVaCommand|setcam||y}} will take care of cleaning up and restore things back to the user's default
 
<code>
 
<code>
{{RLVaCommand|setcam_eyeoffset|-2/-0.4/-0.2|force}}
+
{{RLVaCommand|setcam_eyeoffset|:-2/-0.4/-0.2|force}}
  
{{RLVaCommand|setcam_focusoffset|0.9/-0.7/0.2|force}}
+
{{RLVaCommand|setcam_focusoffset|:0.9/-0.7/0.2|force}}
 
</code>
 
</code>
  
Line 58: Line 99:
 
{{RLVaCommand|setcam_focusoffset||force}}
 
{{RLVaCommand|setcam_focusoffset||force}}
 
</code>
 
</code>
===Focus on an Agent===
 
 
Focus on an agent(get your own UUID) from 20m away with your previous camera orientation.
 
<code>
 
{{RLVaCommand|setcam_focus|uuid;20;|{{RLVaCommandType|force}}}}
 
</code>
 
===Focus on an Object===
 
  
Focus on an object (rez a prim for this and grab its UUID), this will cause the camera to look at the plywood cube (filling the screen) along negative X.
 
<code>
 
{{RLVaCommand|setcam_focus|uuid;;1/0/0|{{RLVaCommandType|force}}}}
 
</code>
 
Now resize the prim (20x20x20m) and retry the command. You'll note that the plywood cube still fills the screen. If you omit the distance RLVa will calculate it based on scale so the object is always fully in view.
 
  
===Focus on an Location===
 
Move the camera to <128, 128, 75> looking down at the land.
 
<code>
 
{{RLVaCommand|setcam_focus|128/128/75;;0/0/1|{{RLVaCommandType|force}}}}
 
</code>
 
  
==Compatibility with existing RLV commands==
 
Existing camera commands that don't fit the setcam_XXX family will currently (silently) translate to their new counterparts this is only a courtesy and these synonyms will be removed in a future release. Please use only @setcam_XXX in any of your products.
 
  
 
[[Category:RLVa]]
 
[[Category:RLVa]]

Latest revision as of 16:30, 21 June 2016

Camera manipulation commands


While we don't anticipate major changes the final implementation and behaviour of these commands isn't set in stone and subject to your feedback.

Setting Camera values

@setcam=<n|y>

Only one object can hold this behaviour at a given time following the same concept as @setenv where a single object can exclusively lock control. Debug output will show "locked" as the failure message on subsequent attempts.

When an object holds the lock, all camera commands from all other objects will be ignored; when the object releases the lock all other camera behaviours will be restored.


@setcam_eyeoffset[:<vector3>]=force

Changes the default camera offset in the same way as changing the CameraOffsetRearView debug setting (the debug setting is not changed).


@setcam_focus<agent|object|position>[;<distance>;<direction>]=force

Moves the camera and focus to the specified position (user can still change focus afterwards).

  • <agent>|<object>|<position> UUID of the object OR agent to focus on OR a position vector (in region coordinates)
  • [<distance>] optional (calculated based on the object's size if omitted) distance of the camera to the focus
  • [<direction>] optional (calculated on current camera if omitted) normalized directional vector

Focus on an agent(get your own UUID) from 20m away with your previous camera orientation. @setcam_focus:<uuid>;20;=force

Focus on an object (rez a prim for this and grab its UUID), this will cause the camera to look at the plywood cube (filling the screen) along negative X. @setcam_focus:<uuid>;;1/0/0=force Now resize the prim (20x20x20m) and retry the command. You'll note that the plywood cube still fills the screen. If you omit the distance RLVa will calculate it based on scale so the object is always fully in view.

Focus on an Location.Move the camera to <128, 128, 75> looking down at the land. @setcam_focus:128/128/75;;0/0/1=force



@setcam_focusoffset[:<vector3>]=force

Changes the default camera focus offset in the same way as changing the FocusOffsetRearView debug setting (the debug setting is not changed).


@setcam_fov:<angle>=force

Changes the camera's vertical field of view to the specified value (angle in radians).


@setcam_fovmin:<angle>=<n|y>

Limit the user's fov angle to a minimum value (angle in radians). Setting @setcam_fovmin & @setcam_fovmax to the same value locks the value.

Set the minimum FOV to 45° @setcam_fovmin0.780=n


@setcam_fovmax:<angle>=<n|y>

Limit the user's fov angle to a maximum value (angle in radians). Setting @setcam_fovmin & @setcam_fovmax to the same value locks the value.

set the maximum FOV to 90° @setcam_fovmax:1.57=n


@setcam_unlock=<n|y>

Force the camera to remain focused on the user's avatar at all times, in effect, making them the fixed centre of the world. Formerly RLV command @camunlock.

Possibly change: currently still allows free camera movement when controlled through by LSL, needs handling and blocking as well?



Camera Control Examples

Change 3rd person camera position & viewpoint

Basic camera position (as detailed in Penny Patton's A Matter of perspective) can be done via the @setcam_eyeoffset and @setcam_focusoffset commands which affect the camera in the same way as the CameraOffsetRearView and FocusOffsetRearView debug settings.

NOTE: if you're using these without @setcam then please restore the default manually after you're done; otherwise @setcam=y will take care of cleaning up and restore things back to the user's default @setcam_eyeoffset:-2/-0.4/-0.2=force

@setcam_focusoffset:0.9/-0.7/0.2=force

Restore default 3rd person camera position & viewpoint

@setcam_eyeoffset=force

@setcam_focusoffset=force