#### Archived

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

# Couple of questions

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

## Recommended Posts

I''m reading the OpenGL Redbook, and I have a couple questions that I''m not to sur about. 1.What is the ''w'' parameter specified in the glVertex*() method? 2.It says that "OpenGL polygons must be convex, meaning that they cannot have indentations. Stated precisely, a region is convex if, given any two points in the interior, the line segment joining them is also in the interior". Ok, I''m not to sure what this exactly means; does it mean that all vertices of the polygon have to be on one plane, meaning they all have to be on the x, y, or z axis? And what does it mean when its refers to ''interior''? 3.The mask that is sent into the glPolygonStipple() method, I don''t really understand the example it used. It says the argument mask is a pointer to a 32*32 bitmap. But from the example I got confused; where is the starting position of the bitmap(like top-left, bottom_left,etc. corner)? do the bits go horizontally or vertically across the bitmap? how is the start of a new row or column on the bitmap made? 4.Lastly, it says "To draw nonconvex polygons, you typically subdivide them into convex polygons. Unfortunately, if you decompose a general polygon into triangles and draw the triangles, you can''t really use glPolygonMode() to draw the polygon''s outline, since you get all the triangle outlines inside it. To solve this problem, you can tell OpenGL whether a particular vertex precedes a boundary edge; OpenGL keeps track of this information by passing along with each vertex a bit indicating whether that vertex is followed by a boundary edge. Then, when a polygon is drawn in GL_LINE mode, the nonboundary edges aren''t drawn." What does the above quote mean by ''precedes a boundry edge''? And how is it determined which lines to draw when some vertices are set as ''boundry edge'' and some aren''t? Any help would be greatly appreciated. Thanks Tom

##### Share on other sites
Well I''ve got 2 and 4 for you..the deal with the concave polygons didn''t hit me till recently when I was doing a screensaver that took a surface and broke it up into puzzle pieces..I was able to map out all the points around each puzzle piece, but when I rendered it only the "outties" would show.. all the "innies" were ignored and rendered flat..a concave polygon is just like the "inny"..OpenGL simple can''t do "innies".. the only way around this ties into number 4..to render the puzzle piece I first had to chop it up into little convex polygons(which is referred to as tesselation)and render them individually..that killed the performance and I ended up going with squares and calling it confetti..if you have no choice I believe there are some OpenGL functions that will do the tesselation for you..

"Like all good things, it starts with a monkey.."

1. 1
Rutin
40
2. 2
3. 3
4. 4
5. 5

• 18
• 20
• 13
• 14
• 9
• ### Forum Statistics

• Total Topics
633365
• Total Posts
3011520
• ### Who's Online (See full list)

There are no registered users currently online

×