Advertisement

Couple of questions

Started by June 22, 2000 10:19 PM
0 comments, last by th032 24 years, 4 months ago
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
AMD Tbird 1GHz 266FSB, ASUS A7V133, Crucial 768MB PC133 SDRAM, PlexWriter 12X/10X/32X CD-RW, Voodoo3 2000 PCI, Creative SoundBlaster Live!, Maxtor 7200rpm 13.3GB, IBM 5200rpm 3.2GB, Samsung 955DF 19" Monitor, LinkSys USB100TX Ethernet Network Adapter,Rogers@Home, Win2000/Linux Mandrake 8.0
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.."
"Like all good things, it starts with a monkey.."

This topic is closed to new replies.

Advertisement