Menu

Cameras

Javier Taibo

Each camera found in the Maya scene will be exported to a separate file with

.osg

extension, prefixed by the main exported base name. For example, if we export a scene to file

testscene.osg

and the scene has a camera called

perspShape

, it will be exported to file

testscene_perspShape.osg

. The

.osg

camera files contain only an

osgViewer

. They are meant to be used with

osgviewer

in two possible forms.

It can be passed as a parameter

osgviewer -c testscene_perspShape.osg testscene.osg

Or can be passed as an environment variable, be it in Linux:

OSG_CONFIG_FILE=testscene_perspShape.osg osgviewer testscene.osg

or in Windows:

set OSG_CONFIG_FILE=testscene_perspShape.osg
osgviewer testscene.osg

Exported attributes

Maya2OSG exports the following Maya camera attributes:

  • View Matrix.
    WARNING: The view matrix is correctly exported, but osgviewer overrides this matrix with a default view locating the whole scene in front of the viewer along -Z. In a future release, a modified version of osgviewer will be included to watch the scenes with the initial camera defined in the config file.
  • Projection matrix. It is exported from the camera rendering frustum, not the viewing frustum.
  • Background color.
  • If Auto Render Clip Plane is unchecked, OSG camera is configured not to compute near and far planes.

Configuration options

Exporter configuration options related to cameras:

  • Export default cameras (bool, default: true)
  • Export orthographic cameras (bool, default: true)

Related

Wiki: Main_Page

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.