Changeset 11237 for OpenSceneGraph/trunk/src/osgPlugins/ply/vertexData.cpp
- Timestamp:
- 03/17/10 15:32:32 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/ply/vertexData.cpp
r10149 r11237 253 253 MESHASSERT( _colors->size() == static_cast< size_t >( nElems ) ); 254 254 } 255 256 result = true; 255 257 } 256 258 catch( exception& e ) … … 306 308 307 309 // If the normals are not calculated calculate the normals for faces 308 if(!_normals.valid()) 309 _calculateNormals(); 310 311 312 // set the normals 313 geom->setNormalArray(_normals.get()); 314 geom->setNormalBinding(osg::Geometry::BIND_PER_VERTEX); 310 if(_triangles.valid()) 311 { 312 if(!_normals.valid()) 313 _calculateNormals(); 314 315 // set the normals 316 geom->setNormalArray(_normals.get()); 317 geom->setNormalBinding(osg::Geometry::BIND_PER_VERTEX); 318 } 315 319 316 320 // Add the premetive set 317 geom->addPrimitiveSet(_triangles.get()); 321 if (_triangles.valid() && _triangles->size() > 0 ) 322 geom->addPrimitiveSet(_triangles.get()); 323 else 324 geom->addPrimitiveSet(new osg::DrawArrays(GL_POINTS, 0, _vertices->size())); 318 325 319 326 // if color info is given set the color array
