View frustrum question.

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Murloc992
Posts: 272
Joined: Mon Apr 13, 2009 2:45 pm
Location: Utena,Lithuania

View frustrum question.

Post by Murloc992 »

I would like to ask about one thing regarding view frustrum and scene nodes. How could I detect if the scene node is FULLY visible by the camera? I mean no vertices go out the screen? I am asking this because I am making rtt system for various sizes of scene nodes and I always want them to be fully visible no matter what size they are. Any advices? :? I have tried checking the bounding boxes of the node and frustrum but it gives nto what I want.
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Re: View frustrum question.

Post by randomMesh »

After a quick search i found this. It's not exactly what you want, but i think you can tweak it easily.
"Whoops..."
Murloc992
Posts: 272
Joined: Mon Apr 13, 2009 2:45 pm
Location: Utena,Lithuania

Post by Murloc992 »

Well that's actually what I have tried, but sadly it didn't work..
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

That's exactly what I used, and it works perfectly fine for me. Are you sure you're passing the transformed bounding box and that the box is calculated correctly? Maybe show me a little code that can reproduce the problem?
Murloc992
Posts: 272
Joined: Mon Apr 13, 2009 2:45 pm
Location: Utena,Lithuania

Post by Murloc992 »

Code is no miracle. It's the same from vitek with transformed box or mine without transformation. The interesting thing is that no matter what the mesh is inside the frustrum, even behind the camera. :?
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

You should take a look at this thread. If what I describe is correct, the planes of the view frustum were backward at one time, and that would make my old code misbehave with current versions of Irrlicht (assuming the bug has been fixed). I provide an example testing the node visibility in that thread. I'm pretty sure it worked back in 2007, but there is always a chance that it doesn't work.

If that is the case, you could also lift the implementation of CSceneManager::isCulled() from here and run with that.

Travis
Post Reply