Any idea how to put Portals into jME?
The idea of a portal is that if a brick wall is between me and the object I want to draw, then don’t bother drawing it because the brick wall is in the way. Or if the brick wall has a hole in it (like a window) then use math to figure out what is visible through the window and only draw it if it’s bounds is visible. This of course is in addiition to view fustrum culling.
A problem is that there can be many “portals” or “windows” through which I can view a model. How would I best check and organize this?
There are portals that act as walls, which prevent viewing. And then those walls have “holes” that allow viewing through those holes. A model can be behind more than one wall and a single wall can have more than one hole in it.
I would highly recommend starting from Eberly’s implementation (as we do for most major features). http://www.magic-software.com/Graphics.html It’s under the sorting catagory.
The book goes into lots of depth, I’ve skimmed the section, but have not yet read too deeply into it.
Forgot to mention, his demo uses a few rooms with doors and windows. So that should handle the early major cases.
Unless I’m reading it wrong, his Portal stuff extends BSP stuff which means I’ld need an implimentation of that to do the Portal stuff
Well, it does make use of a binary tree, so they both use BSPNodes, but I don’t think you have to create a whole BSP (read Quake level) system. I’ll look it up again when I get home tonight. I haven’t read that chapter in a long time.
The coment may be off topic-
I think that we should be able to load it from the jme file format and not have to use another format. Throw if you are doing the work then I guess you should do what is simpler.
Portal is a sorting algorithm, doesn’t really apply to formats directly.
://
Don’t be embarassed though, because it would be pretty nice to be able to load a model and sort it as a Portal. Then you could build levels in 3D Studio Max and load a level.
That’s just a level above the Portal stuff itself.