7.32. SetViewpoint

set_viewpoint ‐ An action for changing a user viewpoint

7.32.1. Attributes

NameTypeDefaults
indexINTEGERNone (required if URI is not provided)
xlink:hrefURIEmpty string

7.32.2. Description

This action is used to change the view_point of the target user(s). The integer value of the index attribute defines rank of the viewpoint (viewpoint #0 is the base viewpoint located at the origin) and viewpoints are ranked according to their order in a depth first traversal of the scene graph. If the string contains parenthesized expressions, they are dynamically evaluated as numerical expressions and their values replace the expressions in the string.

If the index attribute is not provided, the xlink:href attribute must be provided and is used to refer to the current viewpoint by its URI reference.

7.32.3. Expected children

None.

7.32.4. Expected target

The target node must be a user.

7.32.5. Example

The example below defines an action that changes the viewpoint of user user_1 to the first viewpoint.

<action>
  <set_viewpoint index="1" />
  <target type="single_node" value="#user_1" />
</action>  

The example below defines an action that changes the viewpoint of user user_0 to the node with the ID camera_front. This node must contain a viewpoint element.

<action>
  <set_viewpoint  xlink:href="#camera_front" />
  <target type="single_node" value="#user_0" />
</action>