v_sim.GlCamera

Fields

Name

Type

Access

Description

centre

[float]

r/w

position of the eye look at ;

d_red

float

r/w

a factor for perspective from 1. to inifnity. With one, the nose of the observer is completly set on the rendered object, and the size of the observer is neglectible compared to the size of the object.

eye

[float]

r/w

position of the eye.

gross

float

r/w

a value of zoom ;

length0

float

r/w

a length reference to adimension all values, by default, this is the longest diagonal of the current box (without duplication) ;

omega

float

r/w

rotation of the observer on itself ;

phi

float

r/w

the phi angle in spherical coordinates of the position of the observer ;

theta

float

r/w

the theta angle in spherical coordinates of the position of the observer ;

unit

v_sim.Units

r/w

the unit of length0.

up

[float]

r/w

the current up vector.

upAxis

v_sim.XyzDir

r/w

which axis define the north pole.

xs

float

r/w

a value for translation of the viewport on x axis ;

ys

float

r/w

a value for translation of the viewport on y axis ;

Methods

copy (from_)

getRefLength (unit)

getScreenAxes (xAxis, yAxis)

setGross (value)

setPersp (value)

setRefLength (value, unit)

setThetaPhiOmega (valueTheta, valuePhi, valueOmega, mask)

setUpAxis (upAxis)

setXsYs (valueX, valueY, mask)

Details

class v_sim.GlCamera

Values to define the position of the observer.

copy(from_)
Parameters:

from (v_sim.GlCamera) – a v_sim.GlCamera to copy values from

Do a deep copy of from to self.

New in version 3.7.

getRefLength(unit)
Parameters:

unit (v_sim.Units) – a location for unit value (can be None).

Returns:

the current reference length.

Return type:

float

The zoom is define from a reference length in given unit. If unit is provided, the corresponding unit will be set.

New in version 3.6.

getScreenAxes(xAxis, yAxis)
Parameters:
  • xAxis ([float]) – three float values representing x axis ;

  • yAxis ([float]) – three float values representing y axis.

This method is used to get the coordinates in box frame of x axis and y axis of the current camera view.

setGross(value)
Parameters:

value (float) – a positive floating point value.

Returns:

True if value is actually changed.

Return type:

bool

Change the value of the camera zoom value. If the value is higher than 10 it is set to 10 and if the value is negative it is set to 0.001.

setPersp(value)
Parameters:

value (float) – a floating point value greater than 1.1.

Returns:

True if value is actually changed.

Return type:

bool

Change the value of the camera perspective value and put it in bounds if needed.

setRefLength(value, unit)
Parameters:
Returns:

True if the value is indeed changed.

Return type:

bool

Change the reference value that is used for the zoom.

New in version 3.6.

setThetaPhiOmega(valueTheta, valuePhi, valueOmega, mask)
Parameters:
  • valueTheta (float) – a floatinf point value in degrees ;

  • valuePhi (float) – a floating point value in degrees ;

  • valueOmega (float) – a floating point value in degrees ;

  • mask (int) – to specified what values will be changed.

Returns:

a mask of changed values.

Return type:

int

Change the orientation of the camera to the specified angles.

setUpAxis(upAxis)
Parameters:

upAxis (v_sim.XyzDir) – a direction.

In constraint observation mode, the “north” direction is a singular one. Define this direction with this routine.

New in version 3.6.

setXsYs(valueX, valueY, mask)
Parameters:
  • valueX (float) – a floatinf point value in the bounding box scale (1 is the size of the bounding box) ;

  • valueY (float) – a floating point value in bounding box scale ;

  • mask (int) – to specified what values will be changed.

Returns:

a mask of changed values.

Return type:

int

Change the point where the camera is pointed to.