Changeset 4805 for OpenSceneGraph/trunk/examples/osgforest/osgforest.cpp
 Timestamp:
 11/17/05 21:22:55 (12 years ago)
 Files:

 1 modified
Legend:
 Unmodified
 Added
 Removed

OpenSceneGraph/trunk/examples/osgforest/osgforest.cpp
r4505 r4805 358 358 if (image) 359 359 { 360 361 362 360 osg::Texture2D* texture = new osg::Texture2D; 361 texture>setImage(image); 362 stateset>setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON); 363 363 } 364 364 … … 375 375 for(r=0;r<numRows;++r) 376 376 { 377 378 379 380 381 377 for(c=0;c<numColumns;++c) 378 { 379 min_z = osg::minimum(min_z,vertex[r+c*numRows][2]); 380 max_z = osg::maximum(max_z,vertex[r+c*numRows][2]); 381 } 382 382 } 383 383 … … 397 397 for(r=0;r<numRows;++r) 398 398 { 399 400 401 402 399 for(c=0;c<numColumns;++c) 400 { 401 grid>setHeight(c,r,(vertex[r+c*numRows][2]min_z)*scale_z); 402 } 403 403 } 404 404 … … 428 428 pos.x() = origin.x(); 429 429 tex.x() = 0.0f; 430 431 432 433 430 for(c=0;c<numColumns;++c) 431 { 432 v[vi].set(pos.x(),pos.y(),pos.z()+(vertex[r+c*numRows][2]min_z)*scale_z); 433 t[vi].set(tex.x(),tex.y()); 434 434 pos.x()+=columnCoordDelta; 435 435 tex.x()+=columnTexDelta; 436 436 ++vi; 437 437 } 438 438 pos.y() += rowCoordDelta; 439 439 tex.y() += rowTexDelta; … … 450 450 geometry>addPrimitiveSet(&drawElements); 451 451 int ei=0; 452 453 454 455 456 452 for(c=0;c<numColumns;++c) 453 { 454 drawElements[ei++] = (r+1)*numColumns+c; 455 drawElements[ei++] = (r)*numColumns+c; 456 } 457 457 } 458 458