| ARX 1.0 The next-generation open source augmented reality toolkit.

Loading...
Searching...
No Matches
Functions
paramGL.h File Reference

Routines for converting ARParam and matrix types to OpenGL. More...

`#include <ARX/AR/ar.h>`
`#include <ARX/AR/param.h>`
Include dependency graph for paramGL.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions
AR_EXTERN void | arglCameraFrustumRH (const ARParam *cparam, const ARdouble focalmin, const ARdouble focalmax, ARdouble m_projection[16])
| Create an OpenGL perspective projection matrix.
AR_EXTERN void | arglCameraViewRH (const ARdouble para[3][4], ARdouble m_modelview[16], const ARdouble scale)
| Create an OpenGL viewing transformation matrix.
AR_EXTERN void | arglCameraFrustumRHf (const ARParam *cparam, const float focalmin, const float focalmax, float m_projection[16])
AR_EXTERN void | arglCameraViewRHf (float para[3][4], float m_modelview[16], const float scale)

## Detailed Description

Routines for converting ARParam and matrix types to OpenGL.

paramGL provides utility functions for setting the OpenGL viewing frustum and camera position based on artoolkitX- camera parameters and marker positions.

Copyright
  2015-2016 Daqri, LLC.

Version
  5.4

## Function Documentation

## ◆ arglCameraFrustumRH()

AR_EXTERN void arglCameraFrustumRH | ( | const ARParam * | cparam,
|  | const ARdouble | focalmin,
|  | const ARdouble | focalmax,
|  | ARdouble | m_projection[16]
| ) |  |

Create an OpenGL perspective projection matrix.

Use this function to create a matrix suitable for passing to OpenGL to set the viewing projection.

Parameters

  cparam | Pointer to a set of artoolkitX camera parameters for the current video source.
  focalmax | The maximum distance at which geometry will be rendered. Any geometry further away from the camera than this distance will be clipped and will not be appear in a rendered frame. Thus, this value should be set high enough to avoid clipping of any geometry you care about. However, the precision of the depth buffer is correlated with the ratio of focalmin to focalmax, thus you should not set focalmax any higher than it needs to be. This value should be specified in the same units as your OpenGL drawing.
  focalmin | The minimum distance at which geometry will be rendered. Any geometry closer to the camera than this distance will be clipped and will not be appear in a rendered frame. Thus, this value should be set low enough to avoid clipping of any geometry you care about. However, the precision of the depth buffer is correlated with the ratio of focalmin to focalmax, thus you should not set focalmin any lower than it needs to be. Additionally, geometry viewed in a stereo projections that is too close to camera is difficult and tiring to view, so if you are rendering stereo perspectives you should set this value no lower than the near-point of he eyes. The near point in humans varies, but usually lies between 0.1 m 0.3 m. This value should be specified in the same units as your OpenGL drawing.
  m_projection | (description)

Here is the call graph for this function:

## ◆ arglCameraFrustumRHf()

AR_EXTERN void arglCameraFrustumRHf | ( | const ARParam * | cparam,
|  | const float | focalmin,
|  | const float | focalmax,
|  | float | m_projection[16]
| ) |  |

Here is the call graph for this function:

## ◆ arglCameraViewRH()

AR_EXTERN void arglCameraViewRH | ( | const ARdouble | para[3][4],
|  | ARdouble | m_modelview[16],
|  | const ARdouble | scale
| ) |  |

Create an OpenGL viewing transformation matrix.

Use this function to create a matrix suitable for passing to OpenGL to set the viewing transformation of the virtual camera.

The matrix is formed so that the world coordinate system is placed at the centre of the marker, with the marker lying in the x-y plane. The positive x axis points to the right of the marker, the positive y axis to the top of the marker, and the positive z axis out of the marker. This is a right-hand coordinate system with the usual sense for OpenGL graphics.

Parameters

  para | Pointer to 3x4 matrix array of doubles which specify the position of an artoolkitX marker, as returned by arGetTransMat().
  m_modelview | Pointer to a array of 16 GLdoubles, which will be filled out with a modelview matrix suitable for passing to OpenGL. The matrix is specified in column major order.
  scale | Specifies a scaling between artoolkitX's units (usually millimeters) and OpenGL's coordinate system units. What you pass for the scalefactor parameter depends on what units you want to do your OpenGL drawing in. If you use a scalefactor of 1.0, then 1.0 OpenGL unit will equal 1.0 millimetre (artoolkitX's default units). To use different OpenGL units, e.g. metres, then you would pass 0.001.

## ◆ arglCameraViewRHf()

AR_EXTERN void arglCameraViewRHf | ( | float | para[3][4],
|  | float | m_modelview[16],
|  | const float | scale
| ) |  |