Understanding the matrix
The osg::Matrix
is a basic OSG data type which needs not be managed by smart pointers. It supports an interface for 4x4 matrix transformations, such as translate, rotate, scale, and projection operations. It can be set explicitly:
osg::Matrix mat( 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f ); // Just an identity matrix
Other methods and operators include:
- The public methods
postMult()
andoperator*()
post multiply the current matrix object with an input matrix or vector parameter. And the methodpreMult()
performs pre-multiplications. - The
makeTranslate(), makeRotate()
, andmakeScale()
methods reset the current matrix and create a 4x4 translation, rotation, or scale matrix. ...
Get OpenSceneGraph 3.0 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.