~saiarcot895/ubuntu/trusty/openscenegraph/armhf-support

« back to all changes in this revision

Viewing changes to OpenSceneGraph/examples/osganimationviewer/AnimtkViewer.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs
  • Date: 2013-11-12 02:21:14 UTC
  • mfrom: (31.1.3 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20131112022114-qaxfhdnhn88vnh10
Tags: 3.2.0~rc1-1ubuntu1
Fix deprecated url_feof.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*  -*-c++-*- 
 
1
/*  -*-c++-*-
2
2
 *  Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
3
3
 *
4
 
 * This library is open source and may be redistributed and/or modified under  
5
 
 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
 
4
 * This library is open source and may be redistributed and/or modified under
 
5
 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
6
6
 * (at your option) any later version.  The full license is in LICENSE file
7
7
 * included with this distribution, and on the openscenegraph.org website.
8
 
 * 
 
8
 *
9
9
 * This library is distributed in the hope that it will be useful,
10
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
12
 * OpenSceneGraph Public License for more details.
13
13
 *
14
14
 * Authors:
37
37
const int HEIGHT = 900;
38
38
 
39
39
 
40
 
osg::Geode* createAxis() 
 
40
osg::Geode* createAxis()
41
41
{
42
 
    osg::Geode*     geode    = new osg::Geode();  
 
42
    osg::Geode*     geode    = new osg::Geode();
43
43
    osg::Geometry*  geometry = new osg::Geometry();
44
44
    osg::Vec3Array* vertices = new osg::Vec3Array();
45
45
    osg::Vec4Array* colors   = new osg::Vec4Array();
46
 
    
 
46
 
47
47
    vertices->push_back(osg::Vec3(0.0f, 0.0f, 0.0f));
48
48
    vertices->push_back(osg::Vec3(1.0f, 0.0f, 0.0f));
49
49
    vertices->push_back(osg::Vec3(0.0f, 0.0f, 0.0f));
57
57
    colors->push_back(osg::Vec4(0.0f, 1.0f, 0.0f, 1.0f));
58
58
    colors->push_back(osg::Vec4(0.0f, 0.0f, 1.0f, 1.0f));
59
59
    colors->push_back(osg::Vec4(0.0f, 0.0f, 1.0f, 1.0f));
60
 
    
 
60
 
61
61
    geometry->setVertexArray(vertices);
62
 
    geometry->setColorArray(colors);
63
 
    geometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX);    
 
62
    geometry->setColorArray(colors, osg::Array::BIND_PER_VERTEX);
64
63
    geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES, 0, 6));
65
64
    geometry->getOrCreateStateSet()->setMode(GL_LIGHTING, false);
66
65
 
100
99
    }
101
100
};
102
101
 
103
 
int main(int argc, char** argv) 
 
102
int main(int argc, char** argv)
104
103
{
105
104
    osg::ArgumentParser arguments(&argc, argv);
106
105
    arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
153
152
 
154
153
    AnimtkViewerGUI* gui    = new AnimtkViewerGUI(&viewer, WIDTH, HEIGHT, 0x1234);
155
154
    osg::Camera*     camera = gui->createParentOrthoCamera();
156
 
    
 
155
 
157
156
    node->setNodeMask(0x0001);
158
157
 
159
158
    group->addChild(node);