Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

InsanE

portals

This topic is 6387 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I know there are many tutorials on the web but I didn''t found one that describes how I can create the portals with a given set of vertices and faces. It would be very usefull to know how it works ;-) thanks

Share this post


Link to post
Share on other sites
Advertisement
Well, I plan on using a type of area portal in my engine, and this is how I think they work (or at least how mine will work).

Each vertex in the level/modal/whatever is assigned a group number (0,1,2,3,etc.). And when the player/camera/whatever enters a specific area, only the verticies with the same number will be drawn.

Let''s say your camera is floating through this level, and it collides with an imaginary cube (or sphere) that has a group #0. Now, only the verticies with group #0 will be drawn.

Hope this helps.

Share this post


Link to post
Share on other sites
In a portal engine that I created, I structured it differently than the guy in the last response did. There are many different ways to get the same result in programming, but the great thing with portal engines is that object oriented programming seems like it was hand crafted for making portal engines, it works perfectly and really efficiently. I created a world class which holds all of the sector classes, and each sector class holds portals and polygons. Both polygons and portals have 3 or 4 vertices, but polygons are drawn as walls and portals connect the sector you''re in to an adjacent sector. You draw the world by first finding the sector you''re in and drawing it, and if you can see any portals then you draw the sector behind that one, and it continues until all visible sectors are drawn. Hope this helps too. if you''re interested in taking a peek at my (unfinished) engine it''s available at http://quadport.homestead.com/home.html

Share this post


Link to post
Share on other sites
Presumably this is why all Quake2 levels are big rooms connected by small twisty corridors, to limit visibility between sectors. I''d say it''s rare to be able to see more than 2 or 3 sectors at once in either Q2 or Q3A.

Do you also have to work out a clipping volume through visible portals based on the users position, or is that just a further optimization?

Share this post


Link to post
Share on other sites
Thanks for the help but I don''t need to know how to render the portals. I would like to know how to create the portals. Say I have a list of faces with there vertices. Now I want to compile the given faces into portals. How does that work?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If you want, you can use a precomputed BSP tree.

The Quake III Q3MAP program (it compiles maps into the BSP files the game uses) precomputes this. This is how it works:

There are two types of faces: structural and detail. Structural faces are walls, floors, and ceilings. Detail faces are decorations, steps, etc. All detail faces must be enclosed in structural faces. Think of it this way: If you were to remove all the detail faces from your map and run aroudn it, you should not be able to see out of it at all. The "vis" process ignores detail faces during its first stages.

Q3MAP creates a solid volume, and splits it along structural faces into many smaller solid volumes (all convex, btw.). It then discards those volumes not inside the map. Then it calculates what volumes can see what other volume. (Trace lots of lines.) Then it puts detail faces within these volumes. It stores all this information in a file.

Share this post


Link to post
Share on other sites
No I want not to use precalculated BSP trees! That''s why I am asking! If I wanted to use them I had never wrote this post. Until now I have no real information from that posts! Is there noone who is able to give a real info about this?

Share this post


Link to post
Share on other sites
I was the last "Anonymous Poster," who mentioned Q3MAP, just trying to be helpful. But I see you don''t want ANY precomputed information. Ok, so you want EVERYTHING to be calculated on the fly.....

Ah ha! An Idea! (Hopefully a petty good one)

Read the quadtrees article on the front page of gamedev.net. (Here''s the URL of the article: http://www.gamedev.net/reference/programming/features/quadtrees ) Now think of, instead of using two dimensional quadrilaterals as they do, using rectangular prisms. (Preferably cubes, but that requires your level being contained within a cubic volume as well). You could do that. When the cubes would reach a certain size, you''d stop splitting them, and then only render those triangles that have a vertex in a visible cubic volume.

That would work in real time, and would work prety efficiently, too.

How''s that for an idea?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!