# GL_POLYGON

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

## Recommended Posts

Well this seemed like google was a no brainer but I cannot seem to allocate any general information on this. See I got these rooms, all I have are points in the room, so taking this room data and turning it 3D I feel should be a simple process with the theory I've built. Just use GL_POLYGON, if it acts how it sounds, then all the rooms, odd shaped ones even should work out no problem just by throwing the points at GL. Am I right? Is there a limit to the number of points? How fast is it? Is it the slowest of them? how hard is the performance hit (maybe 4 rooms at most being rendered at once)? Will this work for concave convex rooms? Like where some points are actually behind their last point? (Edit: tried to draw some ASCII shape examples but forum messed them up to many times, so imagine convex and concave polygons) I'm trying to find out really if I'm down the right track before I begin programming the project based on this idea. Thanks for any help, Halsafar

##### Share on other sites
You can very easily use GL_POLYGON to render any concave or convex shape. Converting your polygons to a 3d level should be pretty easy, as long as you know the height of the floor and the ceiling in each 'room'. Once you have the floor and ceiling rendered as GL_POLYGON and the sides as GL_QUADS, just render the whole thing as a display list for an immediate performance boost. If you really need more than that for such simple geometry, break it up into smaller segments (all the rooms in once section of the map in one display list, all the rooms in this corner in another, etc.) and render only the ones that the player can see.

##### Share on other sites

http://www.flipcode.com/articles/article_tesselating.shtml

Best is to perform your own tesselation.

##### Share on other sites
As much as I enjoyed Daedalus' answer (wasn't that a FF6 boss?) I believes gold's answer hits the spot more. I read over that entire page, I do believe with a bit of work I can get that to work out for me, except that left a few questions unanswered.

Textures?
If I lay out this complex concave polygon (texture coords included) and allow it to split it up into easy to render convex polygons, will the texture still render okay? Will I run into any problems with some more advanced rendering tecniques using this?

##### Share on other sites
Am I right in thinking that any Convex(and some, if not all, concave) polygons could also be rendered with GL_TRIANGLE_FAN with only one additional point? Would this be faster or slower than GL_POLYGON?

##### Share on other sites
Afaik TRIANGLE_FAN is convex only but I'm not sure.

I'd still like an answer to the texture question, will Polygon Tessellation via GLU totally mess up texturing? Or complicate it... I suppose I'll have to proceed down this road and find out.

##### Share on other sites
Quote:
 Original post by EzbezAm I right in thinking that any Convex(and some, if not all, concave) polygons could also be rendered with GL_TRIANGLE_FAN with only one additional point? Would this be faster or slower than GL_POLYGON?
Triangle fans can render any convex polygon without adding any points. They can render some (certainly not all) concave polygons without adding any points depending on which point you start the fan from, and could render some more concave polygons by using a new point as the first point in the fan. If you have the points for a concave polygon, it is much safer to tesselate it though.
Quote:
 Original post by HalsafarI'd still like an answer to the texture question, will Polygon Tessellation via GLU totally mess up texturing? Or complicate it... I suppose I'll have to proceed down this road and find out.
It complicates it a little bit. Read the Tessellators and Quadrics chapter of the Red Book for more information on using the GLU tesselation routines.

##### Share on other sites
Excellent RedBook article, I'm about half way through it.

What about some crazy shape like this:

Polygon???

Can this be tesselated in any sense?

Edit: That Redbook article above doesn't say more than one minor word on texturing these generated simple convex polygons.

[Edited by - Halsafar on January 12, 2006 2:11:04 PM]

##### Share on other sites
As in, yes that polygon can be tesselated or no that is to much.
I googled for awhile and found no such example of a crazy complex shape like the one above. I find many stars, squares with holes.

All I need a picture of a crazy shape like in my last post and someone saying they where able to tesselate it using the API outlined in the other replies in this thread. If so, then I'm set.

##### Share on other sites
How about this, I think the correct term for this type of polygon is a "Mono-connected polygon". (reference the link a few posts up)

Is the gluTessellation API capable of working with this?

1. 1
2. 2
Rutin
19
3. 3
khawk
19
4. 4
5. 5
A4L
11

• 9
• 12
• 16
• 26
• 10
• ### Forum Statistics

• Total Topics
633771
• Total Posts
3013762
×