Which vertices is observable from the specific camera view in OGRE3D engine?

245 Views Asked by At

I am a new user Ogre3d. My application is in machine vision field. In this regard, I encountered a problem I'm very grateful if you help me. In my application, 3D model (human model) with skeleton and bones loaded. I change bones angle programmatically. I have a camera view.

My question is how can I access to vertices that is observable from the point of view my camera view? In other words, which vertices is visible from the point of view of a specific camera view?

I apologize for my poor English.

1

There are 1 best solutions below

2
On

Edit: You are looking for both frustum and occlusion culling, this answer only deals with the frustum part.

It sounds like you want to check against a Camera's Frustum.

http://www.ogre3d.org/docs/api/1.9/class_ogre_1_1_frustum.html

In particular, look at this function which lets you check a vertex against the frustum:

http://www.ogre3d.org/docs/api/1.9/class_ogre_1_1_frustum.html#aa9acad8da2ff711edfbcc49240e2cb94

virtual bool Ogre::Frustum::isVisible(const Vector3 & vert,
                                      FrustumPlane * culledBy = 0) const

Note that you might want to check the whole object first for performance, depending on how your scene looks. There are useful functions for checking against bounding boxes or spheres too, in case you need them.