Macro Rotate View/it: Difference between revisions

From FreeCAD Documentation
(Created page with "Questa macro ruota la vista corrente di 90° a sinistra. Funziona solo se si è in vista dall'alto")
(Updating to match new version of source page)
Line 5: Line 5:


<syntaxhighlight>
<syntaxhighlight>
import math
import math
from pivy import coin
from pivy import coin
cam = Gui.ActiveDocument.ActiveView.getCameraNode()
cam = Gui.ActiveDocument.ActiveView.getCameraNode()
rot = coin.SbRotation()
rot = coin.SbRotation()
rot.setValue(coin.SbVec3f(0,0,1),math.pi/2)
rot.setValue(coin.SbVec3f(0,0,1),math.pi/2)
nrot = cam.orientation.getValue() * rot
nrot = cam.orientation.getValue() * rot
cam.orientation = nrot
cam.orientation = nrot


</syntaxhighlight>
</syntaxhighlight>

Revision as of 10:54, 6 May 2014

File:Text-x-python Rotate View by 90°

Descrizione
Questa macro ruota la vista corrente di 90° a sinistra. Funziona solo se si è in vista dall'alto

Autore: Yorik
Autore
Yorik
Download
None
Link
Versione macro
1.0
Data ultima modifica
None
Versioni di FreeCAD
None
Scorciatoia
Nessuna
Vedere anche
Nessuno

Questa macro ruota la vista corrente di 90° a sinistra. Funziona solo se si è in vista dall'alto


import math
from pivy import coin
cam = Gui.ActiveDocument.ActiveView.getCameraNode()
rot = coin.SbRotation()
rot.setValue(coin.SbVec3f(0,0,1),math.pi/2)
nrot = cam.orientation.getValue() * rot
cam.orientation = nrot