Difference between revisions of "API Panel.Position.Camera.SetLookAt"
From Flowcode Help
Jump to navigationJump to search (XML import) |
|||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | <sidebar>API | + | <sidebar>API Contents</sidebar> |
Sets the eye and target point of the camera | Sets the eye and target point of the camera | ||
Line 12: | Line 12: | ||
==Parameters== | ==Parameters== | ||
− | [[Variable | + | [[Variable Types|HANDLE]] ''Eye'' |
:The position of the eye to set the camera to | :The position of the eye to set the camera to | ||
− | [[Variable | + | [[Variable Types|HANDLE]] ''Target'' |
:The position of the target to set the camera to | :The position of the target to set the camera to | ||
− | [[Variable | + | [[Variable Types|BOOL]] ''Animate'' |
:True to animate movement from the current position | :True to animate movement from the current position | ||
+ | |||
==Return value== | ==Return value== | ||
Line 26: | Line 27: | ||
==Detailed description== | ==Detailed description== | ||
− | '' | + | This call is the equivalent of calling both the [[API Panel.Position.Camera.SetEye|SetEye]] and [[API Panel.Position.Camera.SetTarget|SetTarget]] calls. |
+ | |||
+ | |||
+ | The ''Eye'' and ''Target'' are used to calculate the camera coordinates. The orientation of the camera is calculated by taking the ''up-vector'' of the ''Eye'' position and rotating this to look at the target. If the up-vector is parallel to the vector from the eye to target, an orthogonal vector is chosen as ''up''. | ||
+ | |||
Line 33: | Line 38: | ||
* Add to a calculation icon: <pre class="brush:[cpp]">::Panel.Position.Camera.SetLookAt(eye, target, false)</pre> | * Add to a calculation icon: <pre class="brush:[cpp]">::Panel.Position.Camera.SetLookAt(eye, target, false)</pre> | ||
− | + | ===SetLookAt=== | |
+ | |||
+ | Simple example to move the camera and focus the camera. | ||
+ | |||
+ | {{Fcfile|CameraSetLookAt.fcfx|CameraSetLookAt}} |
Latest revision as of 14:57, 11 May 2016
<sidebar>API Contents</sidebar> Sets the eye and target point of the camera
Contents
Parameters
HANDLE Eye
- The position of the eye to set the camera to
HANDLE Target
- The position of the target to set the camera to
BOOL Animate
- True to animate movement from the current position
Return value
This call does not return a value
Detailed description
This call is the equivalent of calling both the SetEye and SetTarget calls.
The Eye and Target are used to calculate the camera coordinates. The orientation of the camera is calculated by taking the up-vector of the Eye position and rotating this to look at the target. If the up-vector is parallel to the vector from the eye to target, an orthogonal vector is chosen as up.
Examples
Calling in a calculation
- Add to a calculation icon:
::Panel.Position.Camera.SetLookAt(eye, target, false)
SetLookAt
Simple example to move the camera and focus the camera.