Difference between revisions of "API Panel.Position.Camera.SetLookAt"
From Flowcode Help
Jump to navigationJump to search (XML import) |
|||
(10 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 | ||
<div style="width:25%; float:right" class="toc"> | <div style="width:25%; float:right" class="toc"> | ||
− | ===Class hierarchy=== | + | ====Class hierarchy==== |
− | + | [[API Panel|Panel]] | |
− | : | + | :[[API Panel.Position|Position]] |
− | :: | + | ::[[API Panel.Position.Camera|Camera]] |
− | ::: | + | :::[[API Panel.Position.Camera|SetLookAt]] |
</div> | </div> | ||
__TOC__ | __TOC__ | ||
==Parameters== | ==Parameters== | ||
− | + | [[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 Types|HANDLE]] ''Target'' | |
:The position of the target to set the camera to | :The position of the target to set the camera to | ||
− | + | [[Variable Types|BOOL]] ''Animate'' | |
:True to animate movement from the current position | :True to animate movement from the current position | ||
+ | |||
==Return value== | ==Return value== | ||
''This call does not return a value'' | ''This call does not return a value'' | ||
+ | |||
==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''. | ||
+ | |||
+ | |||
==Examples== | ==Examples== | ||
===Calling in a calculation=== | ===Calling in a calculation=== | ||
* 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.