0

I have start working with openinventor. I have a socube in viewer. I would like to check if socube is infront of camera or not. So when I move cube somewhere away from camera view value should be false.

SoSeparator root = new SoSeparator(); 
SoMaterial Material = new SoMaterial(); 
Material.diffuseColor.SetValue(1.0f, 0.0f, 0.0f);     // Red 
root.AddChild(Material); 
root.AddChild(new SoCone()); 
viewer = new SoWinExaminerViewer(this); 
viewer.SetTitle("Example 1.1 .NET"); 
viewer.SetSceneGraph(root); 
viewer.ViewAll(); 

Now I want to add a behavior something like if I move cone away from camera it returns false

Andrew Mortimer
  • 2,380
  • 7
  • 31
  • 33
1Aisha
  • 1

1 Answers1

0

I confirm that Open Inventor does not provide a method that implements this query. However it is possible to write one using information you can query.

If you can accept an approximately correct answer, then your goal is to answer the question: Does the bounding box of the geometry intersect the view frustum? Get the bounding box using SoGetBoundingBoxAction, then get the current view volume parameters from the current camera, e.g. viewer->getCamera()->getViewVolume().

mike
  • 186
  • 3