Quantcast
Channel: MarsHut
Viewing all articles
Browse latest Browse all 6551

Using osg::Camera without a view

$
0
0
Hiya,

This is a bit of a strange question. I want to use an osg::Camera purely as
a shell object to use some of its handy methods (ie. all the setters and
getters for the various view/model/projection matrices). Can I do this
without setting up a viewer or invoking any OpenGL code (assume inactive
context)?

If I do something like:

// note there's no osgViewer here
osg::Camera cam;
cam.setViewport(...);
cam.setViewMatrixAsLookAt(...);
cam.setProjectionMatrixAsPerspective(...);
osg::Matrixd viewMatrix = cam.getViewMatrix();

Will this 'just work'? Or is there internal stuff in osg::Camera that needs
the object to belong to a viewer / have a proper view/context/etc setup?

Preet

Viewing all articles
Browse latest Browse all 6551

Trending Articles