Gui::Camera Class Reference

#include <View3DPy.h>

Public Types

enum  Orientation {
  Top , Bottom , Front , Rear ,
  Left , Right , Isometric , Dimetric ,
  Trimetric
}
 

Static Public Member Functions

static SbRotation rotation (Orientation view)
 Formulas to get quaternion for axonometric views: More...
 

Member Enumeration Documentation

◆ Orientation

Enumerator
Top 
Bottom 
Front 
Rear 
Left 
Right 
Isometric 
Dimetric 
Trimetric 

Member Function Documentation

◆ rotation()

SbRotation Camera::rotation ( Camera::Orientation  view)
static

Formulas to get quaternion for axonometric views:

from math import sqrt, degrees, asin, atan
p1=App.Rotation(App.Vector(1,0,0),90)
p2=App.Rotation(App.Vector(0,0,1),alpha)
p3=App.Rotation(p2.multVec(App.Vector(1,0,0)),beta)
p4=p3.multiply(p2).multiply(p1)
from pivy import coin
c=Gui.ActiveDocument.ActiveView.getCameraNode()
c.orientation.setValue(*p4.Q)

The angles alpha and beta depend on the type of axonometry Isometric:

alpha=45
beta=degrees(asin(-sqrt(1.0/3.0)))

Dimetric:

alpha=degrees(asin(sqrt(1.0/8.0)))
beta=degrees(-asin(1.0/3.0))

Trimetric:

alpha=30.0
beta=-35.0

Verification code that the axonomtries are correct:

from pivy import coin
c=Gui.ActiveDocument.ActiveView.getCameraNode()
vo=App.Vector(c.getViewVolume().getMatrix().multVecMatrix(coin.SbVec3f(0,0,0)).getValue())
vx=App.Vector(c.getViewVolume().getMatrix().multVecMatrix(coin.SbVec3f(10,0,0)).getValue())
vy=App.Vector(c.getViewVolume().getMatrix().multVecMatrix(coin.SbVec3f(0,10,0)).getValue())
vz=App.Vector(c.getViewVolume().getMatrix().multVecMatrix(coin.SbVec3f(0,0,10)).getValue())
(vx-vo).Length
(vy-vo).Length
(vz-vo).Length
# Projection
vo.z=0
vx.z=0
vy.z=0
vz.z=0
(vx-vo).Length
(vy-vo).Length
(vz-vo).Length

See also: http://www.mathematik.uni-marburg.de/~thormae/lectures/graphics1/graphics_6_2_ger_web.html#1 http://www.mathematik.uni-marburg.de/~thormae/lectures/graphics1/code_v2/Axonometric/qt/Axonometric.cpp https://de.wikipedia.org/wiki/Arkussinus_und_Arkuskosinus

References Bottom, Dimetric, Front, Isometric, Left, Rear, Right, Top, and Trimetric.

Referenced by femtaskpanels.task_element_rotation1D._TaskPanel::accept(), Gui::AbstractSplitView::onMsg(), Gui::View3DInventor::onMsg(), femtaskpanels.task_element_rotation1D._TaskPanel::rotation_changed(), Gui::View3DInventorPy::viewBottom(), Gui::View3DInventorPy::viewDefaultOrientation(), Gui::View3DInventorPy::viewDimetric(), Gui::View3DInventorPy::viewFront(), Gui::View3DInventorPy::viewIsometric(), Gui::View3DInventorPy::viewLeft(), Gui::View3DInventorPy::viewRear(), Gui::View3DInventorPy::viewRight(), Gui::View3DInventorPy::viewTop(), and Gui::View3DInventorPy::viewTrimetric().


The documentation for this class was generated from the following files: