Hi, I am new to Open Inventor. I have a SoVRMLShape object, how can I get center of that object ? Here some code that I have tried:
Here I thought that SoGetBoundingBoxAction object will be set after
but it throws an exception (Access violation reading location). How to do it in proper way or is it another method to get center of the SoVRMLShape ?
Best regards,
Oleksa.
Code:
SbVec3f GetBBoxCenter(SoVRMLShape* shape) { SoVRMLGeometry* geometry = static_cast<::SoVRMLGeometry*>(shape->geometry.getValue()); SoGetBoundingBoxAction* action; geometry->getBoundingBox(action); SbBox3f bb = action->getBoundingBox(); return bb.getCenter(); }
Code:
geometry->getBoundingBox(action);
Best regards,
Oleksa.
Comment