Difference between revisions of "SetViewDirection Command"
From GeoGebra Manual
m (typo) |
(add examples, * if you do <code>SetViewDirection((0, 0, 1))</code> twice then then second one will rotate the view 180°) |
||
Line 2: | Line 2: | ||
;SetViewDirection( <Direction> ) | ;SetViewDirection( <Direction> ) | ||
:Sets the direction of the 3D view orientation depending on the given object. | :Sets the direction of the 3D view orientation depending on the given object. | ||
+ | :{{example| 1=<code><nowiki>SetViewDirection(Vector((0, 0, 1)))</nowiki></code>}} | ||
:{{example| 1=<code><nowiki>SetViewDirection((0, 0, 1))</nowiki></code>}} | :{{example| 1=<code><nowiki>SetViewDirection((0, 0, 1))</nowiki></code>}} | ||
+ | :{{example| 1=<code><nowiki>SetViewDirection(x + y + z = 1)</nowiki></code>}} | ||
;SetViewDirection( ) | ;SetViewDirection( ) | ||
Line 12: | Line 14: | ||
:{{example|1=In order to obtain the rotation of the 3D view, depending on the values of a previously created slider ''α'', use the command <code><nowiki>SetViewDirection(Vector((1; α; -30°)), false)</nowiki></code> in the ''OnUpdate'' scripting tab of slider ''α''.}} | :{{example|1=In order to obtain the rotation of the 3D view, depending on the values of a previously created slider ''α'', use the command <code><nowiki>SetViewDirection(Vector((1; α; -30°)), false)</nowiki></code> in the ''OnUpdate'' scripting tab of slider ''α''.}} | ||
− | {{ | + | {{notes| 1= |
*The view direction can be set towards a line, segment, plane, etc. | *The view direction can be set towards a line, segment, plane, etc. | ||
+ | * if you do <code>SetViewDirection((0, 0, 1))</code> twice then then second one will rotate the view 180° | ||
*See also [[Image:Mode viewinfrontof.png|link=|24px]] [[View in front of Tool|View in front of]] tool.}} | *See also [[Image:Mode viewinfrontof.png|link=|24px]] [[View in front of Tool|View in front of]] tool.}} |
Revision as of 07:56, 4 August 2019
- SetViewDirection( <Direction> )
- Sets the direction of the 3D view orientation depending on the given object.
- Example:
SetViewDirection(Vector((0, 0, 1)))
- Example:
SetViewDirection((0, 0, 1))
- Example:
SetViewDirection(x + y + z = 1)
- SetViewDirection( )
- Sets the direction of the 3D view orientation to the default position.
- Example:
SetViewDirection()
- SetViewDirection( <Direction>, <Boolean animated> )
- Sets the direction of the 3D view orientation depending on the given object, with optional animation.
- Example: In order to obtain the rotation of the 3D view, depending on the values of a previously created slider α, use the command
SetViewDirection(Vector((1; α; -30°)), false)
in the OnUpdate scripting tab of slider α.
Notes:
- The view direction can be set towards a line, segment, plane, etc.
- if you do
SetViewDirection((0, 0, 1))
twice then then second one will rotate the view 180° - See also View in front of tool.