~ubuntu-branches/debian/sid/openscenegraph/sid

« back to all changes in this revision

Viewing changes to OpenSceneGraph/examples/osgtexturerectangle/osgtexturerectangle.cpp

  • Committer: Package Import Robot
  • Author(s): Manuel A. Fernandez Montecelo, Alberto Luaces, Manuel A. Fernandez Montecelo
  • Date: 2013-07-30 13:07:57 UTC
  • mfrom: (1.4.3)
  • Revision ID: package-import@ubuntu.com-20130730130757-b3weq3502sennb16
Tags: 3.2.0~rc1-1
[Alberto Luaces]
* New upstream release.
* Updated standards version (3.9.4).
* Updated SVN URL.
* Removed the static version of the libraries since they impose a huge
  load on the build servers, add additional complexity on the build
  scripts, and make a great impact on the size of the packages, given
  the very small cases where they are useful.
* Acknowledge NMU.

[ Manuel A. Fernandez Montecelo ]
* Switch to @debian.org address

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
    osg::Vec3 bottom_left(bb.xMin(),bb.yMax(),bb.zMin());
115
115
    osg::Vec3 bottom_right(bb.xMax(),bb.yMax(),bb.zMin());
116
116
    osg::Vec3 top_right(bb.xMax(),bb.yMax(),bb.zMax());
117
 
    
 
117
 
118
118
    // create geometry
119
119
    osg::Geometry* geom = new osg::Geometry;
120
120
 
124
124
    (*vertices)[2] = bottom_right;
125
125
    (*vertices)[3] = top_right;
126
126
    geom->setVertexArray(vertices);
127
 
    
 
127
 
128
128
    osg::Vec2Array* texcoords = new osg::Vec2Array(4);
129
129
    (*texcoords)[0].set(0.0f, 0.0f);
130
130
    (*texcoords)[1].set(1.0f, 0.0f);
134
134
 
135
135
    osg::Vec3Array* normals = new osg::Vec3Array(1);
136
136
    (*normals)[0].set(0.0f,-1.0f,0.0f);
137
 
    geom->setNormalArray(normals);
138
 
    geom->setNormalBinding(osg::Geometry::BIND_OVERALL);
 
137
    geom->setNormalArray(normals, osg::Array::BIND_OVERALL);
139
138
 
140
139
    osg::Vec4Array* colors = new osg::Vec4Array(1);
141
140
    (*colors)[0].set(1.0f,1.0f,1.0f,1.0f);
142
 
    geom->setColorArray(colors);
143
 
    geom->setColorBinding(osg::Geometry::BIND_OVERALL);
 
141
    geom->setColorArray(colors, osg::Array::BIND_OVERALL);
144
142
 
145
143
    geom->addPrimitiveSet(new osg::DrawArrays(GL_QUADS, 0, 4));
146
144
 
161
159
    state->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON);
162
160
    state->setTextureAttributeAndModes(0, texmat, osg::StateAttribute::ON);
163
161
 
164
 
    // turn off lighting 
 
162
    // turn off lighting
165
163
    state->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
166
164
 
167
165
    // install 'update' callback
168
166
    osg::Geode* geode = new osg::Geode;
169
167
    geode->addDrawable(geom);
170
168
    geode->setUpdateCallback(new TexturePanCallback(texmat));
171
 
    
 
169
 
172
170
    return geode;
173
171
}
174
172
 
262
260
 
263
261
    // add model to viewer.
264
262
    viewer.setSceneData(rootNode);
265
 
    
 
263
 
266
264
    return viewer.run();
267
265
}