osg.Viewport¶
-
class
osg.Viewport¶ Represents: c++ class Wraps: osg::Viewport Bases: osg.StateAttributeEncapsulate 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) -
Parameters: - x (
double) – - y (
double) – - width (
double) – - height (
double) –
- x (
Methods:
-
:
setViewport(double x, double y, double width, double height)¶ -
Parameters: - x (
double) – - y (
double) – - width (
double) – - height (
double) –
- x (
-
:
x()¶ -
Return type: double
-
:
x(double value) -
Parameters: value ( double) –
-
:
y()¶ -
Return type: double
-
:
y(double value) -
Parameters: value ( double) –
-
:
width()¶ -
Return type: double
-
:
width(double value) -
Parameters: value ( double) –
-
:
height()¶ -
Return type: double
-
:
height(double value) -
Parameters: value ( double) –
-
:
valid()¶ -
Return type: 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.Return type: 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.Stateobject, viaosgUtil.SceneVieworosgUtil.CullVisitor:.Return type: osg.Matrix
-