osg.Viewport

class osg.Viewport
Represents:c++ class
Wraps:osg::Viewport
Bases:osg.StateAttribute

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 is ModelViewMatrix * ProjectionMatrix * WindowMatrix, the latter supplied by osg.Viewport.computeWindowMatrix(), the ModelView and Projection Matrix can either be sourced from the current osg.State object, via osgUtil.SceneView or osgUtil.CullVisitor:.

Тип результата:osg.Matrix