Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplay GL_TRIANGLE_STRIP as wireframe
    text
    copied!<p>I'm struggling to get an opengl triangle strip to display as a wireframe. My display algorithm looks something like this:</p> <pre><code>// want to display by strip here to allow for quick processing of each of the polygons that we need // allow a quick strip of polygons to be drawn glBegin(GL_TRIANGLE_STRIP); // set the triangle strip up for front-facing drawing to allow for clockwise // glFrontFace(GL_CW); // cache height / width etc of this element int height = int(heightField-&gt;getHeight()), width = int(heightField-&gt;getWidth()); // want to loop through each row, stopping one from the bottom for (int y = height -2; y &gt;= 0; --y) { // we want to circle for each element in the next for loop and counter-clockwise add our vertices to the point for (int x = 0; x &lt; width - 2; ++x ) { // http://en.wikipedia.org/wiki/Triangle_strip -- for reference on the element glVertex3fv(heightField-&gt;getVertex(x, y+1));//add the left corner point -- point 1 glVertex3fv(heightField-&gt;getVertex(x, y));//add the current point -- point 2 glVertex3fv(heightField-&gt;getVertex(x+1, y+1));//add the next point -- point 3 glVertex3fv(heightField-&gt;getVertex(x+1, y));//add the 4th point -- point 4 } } // end the triangle strip glEnd(); glDisable(GL_POLYGON_OFFSET_LINE); </code></pre> <p>Basically, what I'm doing is starting the gl_triangle_strip and then plotting the x,y,z coordinates for each point in my heightfield object. </p> <p>Basically what this draws out is a big white blob, I'm trying to show just the wireframe of the different points. Does anyone have any ideas on how to do this?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload