Download presentation
Presentation is loading. Please wait.
1
Homework Tips
2
We will learn What actions are Apply actions to a node or a path Compute 3D bounding box Compute cumulative transformation matrix Insert callbacks for GLRender action
3
Actions We learned how to build the scene graph We saw the most commonly used action –GL Rendering
4
Applying action Action is applied to a node The graph rooted by the node is traversed Each node implements its own behavior Initialize the action Apply Obtain the results
5
Bounding box // Initilization. If use new, use also delete SbViewportRegion vpr = viewer->getViewportRegion(); SoGetBoundingBoxAction bboxAction (vpr); // Apply action to a pointer to node bboxAction.apply(node); // Obtain results bboxAction.getCenter(); bboxAction.getBoundingBox(); // aligned with XYZ bboxAction.getXFBoundingBox(); // The most accurate
6
Transformation matrix // Initilization SoGetMatrixAction mtxAction; // Apply to transformation node or to a path mtxAction.apply(transformation node) // Obtain results mtxAction.getMatrix(); mtxAction.getInverse();
7
GLRender callbacks Inventor Toolmaker, chapter 2. Define your class: class MyClass: public SoNode{ // Callback for rendering virtual void GLRender(SoGLRenderAction *action); } Implement GLRender() in Cpp file void GLRender(SoGLRenderAction *action){ SoNode::GLRender(action); // Important to call the original }
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.