Changes between Version 6 and Version 7 of Support/Tutorials/Textures

Show
Ignore:
Timestamp:
07/02/08 11:32:40 (6 years ago)
Author:
robert (IP: 217.155.192.154)
Comment:

Removed indices

Legend:

Unmodified
Added
Removed
Modified
  • Support/Tutorials/Textures

    v6 v7  
    4242   // code to create other faces goes here! 
    4343   // (removed to save space, see tutorial two) 
     44 
    4445   osg::Vec4Array* colors = new osg::Vec4Array; 
    4546   colors->push_back(osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f) ); //index 0 red 
     
    4748   colors->push_back(osg::Vec4(0.0f, 0.0f, 1.0f, 1.0f) ); //index 2 blue 
    4849   colors->push_back(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f) ); //index 3 white 
    49  
    50    osg::TemplateIndexArray 
    51       <unsigned int, osg::Array::UIntArrayType,4,4> *colorIndexArray; 
    52    colorIndexArray =  
    53       new osg::TemplateIndexArray<unsigned int, osg::Array::UIntArrayType,4,4>; 
    54    colorIndexArray->push_back(0); // vertex 0 assigned color array element 0 
    55    colorIndexArray->push_back(1); // vertex 1 assigned color array element 1 
    56    colorIndexArray->push_back(2); // vertex 2 assigned color array element 2 
    57    colorIndexArray->push_back(3); // vertex 3 assigned color array element 3 
    58    colorIndexArray->push_back(0); // vertex 4 assigned color array element 0 
     50   colors->push_back(osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f) ); //index 4 red 
    5951 
    6052   pyramidGeometry->setColorArray(colors); 
    61    pyramidGeometry->setColorIndices(colorIndexArray); 
    6253   pyramidGeometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX); 
    6354