osg.Viewport¶
- class osg.Viewport¶
- Represents
c++ class
- Wraps
osg::Viewport
- Bases
Encapsulate OpenGL
glViewport
(https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glViewport.xml).Constructors:
- osg.Viewport()¶
- osg.Viewport(double x, double y, double width, double height)
-
- Параметры
x (
double
) –y (
double
) –width (
double
) –height (
double
) –
Methods:
- :setViewport(double x, double y, double width, double height)¶
-
- Параметры
x (
double
) –y (
double
) –width (
double
) –height (
double
) –
- :x()¶
-
- Тип результата
double
- :x(double value)
-
- Параметры
value (
double
) –
- :y()¶
-
- Тип результата
double
- :y(double value)
-
- Параметры
value (
double
) –
- :width()¶
-
- Тип результата
double
- :width(double value)
-
- Параметры
value (
double
) –
- :height()¶
-
- Тип результата
double
- :height(double value)
-
- Параметры
value (
double
) –
- :valid()¶
-
- Тип результата
bool
- :aspectRatio()¶
Return the aspectRatio of the viewport, which is equal to width/height. If height is zero, the potential division by zero is avoided by simply returning
1.0f
.- Тип результата
double
- :computeWindowMatrix()¶
Compute the Window Matrix which takes projected coords into Window coordinates. To convert local coordinates into window coordinates use
v_window = v_local * MVPW matrix
, where the MVPW matrix isModelViewMatrix * ProjectionMatrix * WindowMatrix
, the latter supplied byosg.Viewport.computeWindowMatrix()
, the ModelView and Projection Matrix can either be sourced from the currentosg.State
object, viaosgUtil.SceneView
orosgUtil.CullVisitor
:.- Тип результата