Difference between revisions of "SetViewDirection Command"

From GeoGebra Manual
Jump to: navigation, search
m (updated icon)
m (typo)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|3D}}
 
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|3D}}
;SetViewDirection[ <Direction> ]
+
;SetViewDirection( <Direction> )
:Sets the 3D view orientation regarding the direction.
+
:Sets the direction of the 3D view orientation depending on the given object.
:{{example| 1=<div><code><nowiki>SetViewDirection[(0, 0, 1)]</nowiki></code></div>}}
+
:{{example| 1=<code><nowiki>SetViewDirection(Vector((0, 0, 1)))</nowiki></code>}}
{{note| 1=
+
:{{example| 1=<code><nowiki>SetViewDirection((0, 0, 1))</nowiki></code>}}
*The view direction can also be set towards a line, segment, plane, etc.
+
:{{example| 1=<code><nowiki>SetViewDirection(x + y + z = 1)</nowiki></code>}}
*See also [[Image:Mode viewinfrontof.svg|link=|24px]] [[View in front of Tool|View in front of]] tool.}}
+
 
 +
;SetViewDirection( )
 +
:Sets the direction of the 3D view orientation to the default position.
 +
:{{example| 1=<code><nowiki>SetViewDirection()</nowiki></code>}}
 +
 
 +
;SetViewDirection( <Direction>, <Boolean animated> )
 +
:Sets the direction of the 3D view orientation depending on the given object, with optional animation.
 +
:{{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.
 +
* If you do eg <code>SetViewDirection(x + y + z = 1)</code> twice then there are two possible outcomes and the ''second'' one will rotate the view 180°. To avoid ambiguity use eg <code>SetViewDirection(Vector((0, 0, 1)))</code>
 +
*See also [[Image:Mode viewinfrontof.png|link=|24px]] [[View in front of Tool|View in front of]] tool.}}

Latest revision as of 10:04, 3 December 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 eg SetViewDirection(x + y + z = 1) twice then there are two possible outcomes and the second one will rotate the view 180°. To avoid ambiguity use eg SetViewDirection(Vector((0, 0, 1)))
  • See also Mode viewinfrontof.png View in front of tool.
© 2024 International GeoGebra Institute