Changeset 319 for experimental
- Timestamp:
- Sep 8, 2011, 7:19:51 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/distortionNG/extViewer.cpp
r318 r319 187 187 geom->getOrCreateStateSet()->setMode(GL_CULL_FACE, osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED); 188 188 189 for ( unsigned int row=0; row<rows; ++row)189 for ( unsigned int row=0; row<rows; row++ ) 190 190 { 191 for ( unsigned int col=0; col<columns; ++col)191 for ( unsigned int col=0; col<columns; col++ ) 192 192 { 193 193 vertices->push_back( origin+dy*row+dx*col ); … … 223 223 // geometry->addPrimitiveSet(elements); 224 224 225 for ( unsigned int row=0; row<rows ; ++row )225 for ( unsigned int row=0; row<rows-1; row++ ) // each strip consists of two affected vertex rows, so we need only row-1 strips. 226 226 { 227 osg::ref_ptr<osg::DrawElementsUInt> de = new osg::DrawElementsUInt(GL_QUAD_STRIP, columns*2); 228 for ( unsigned int col=0; col<columns; ++col)227 osg::ref_ptr<osg::DrawElementsUInt> de = new osg::DrawElementsUInt(GL_QUAD_STRIP, columns*2); // columns*2 = number of involved vertices for this strip. 228 for ( unsigned int col=0; col<columns; col++ ) 229 229 { 230 230 (*de)[col*2 + 0] = row*columns + col;
Note: See TracChangeset
for help on using the changeset viewer.