SclViewport getTargetPosition
Overview
You use this command to get the x, y, and z coordinates of the target position of the camera for the viewport.
Synopsis
SclViewport getTargetPosition <$viewportHandle> <x> <y> <z>
Description
Get the position of the camera target for the viewport referred to by the handle. The camera target values in each direction are returned into the named Tcl variables x, y, and z.
Arguments
- getTargetPosition
- <$viewportHandle>
- <x>
- <y>
- <z>
A literal string to identify the function.
The reference handle to the viewport of interest.
Returns the x position of the camera target.
Returns the y position of the camera target.
Returns the x position of the camera target.
Returns
If successful, this command returns $SCL_OK. If the viewport handle is not valid, an error message is returned.
Examples
# Get and set the camera target for a viewport set vp [SclViewport getActive] SclViewport getTargetPosition $vp xPos yPos zPos puts "Camera target is at X=$xPos ; Y=$yPos ; Z=$zPos" # Move the camera 100 metres right SclViewport setTargetPosition $vp [expr $xPos + 100] $yPos $zPos SclViewport getTargetPosition $vp xPos yPos zPos puts "Camera target is now X=$xPos ; Y=$yPos ; Z=$zPos" |