- Timestamp:
- 08/06/04 10:22:58 (9 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgautotransform/osgautotransform.cpp
r2022 r3245 72 72 } 73 73 74 osg::Node* createAxis(const osg::Vec3& s, const osg::Vec3& e, int numReps )74 osg::Node* createAxis(const osg::Vec3& s, const osg::Vec3& e, int numReps, osg::AutoTransform::AutoRotateMode autoRotateMode, const std::string& str) 75 75 { 76 76 osg::Group* group = new osg::Group; … … 81 81 osg::Vec3 pos = s; 82 82 83 bool useAuto = false;83 bool useAuto = true; 84 84 if (useAuto) 85 85 { … … 90 90 osg::AutoTransform* at = new osg::AutoTransform; 91 91 at->setPosition(pos); 92 at->setAutoRotateToScreen(true); 93 at->setAutoScaleToScreen(true); 94 at->addChild(createLabel(osg::Vec3(0.0f,0.0f,0.0f),40.0f,"Test 2")); 92 at->setAutoRotateMode(autoRotateMode); 93 at->addChild(createLabel(osg::Vec3(0.0f,0.0f,0.0f),dv.length()*0.2f,str)); 95 94 vertices->push_back(pos); 96 95 pos += dv; … … 119 118 for(int i=0;i<numReps;++i) 120 119 { 121 group->addChild(createLabel3(osg::Vec3(pos),dv.length()*0.5f, "Test 2"));120 group->addChild(createLabel3(osg::Vec3(pos),dv.length()*0.5f,str)); 122 121 vertices->push_back(pos); 123 122 pos += dv; … … 147 146 osg::Group* root = new osg::Group; 148 147 149 int numReps = 3333;150 //int numReps = 10;151 root->addChild(createAxis(osg::Vec3(0.0,0.0,0.0),osg::Vec3(1000.0,0.0,0.0),numReps ));152 root->addChild(createAxis(osg::Vec3(0.0,0.0,0.0),osg::Vec3(0.0,1000.0,0.0),numReps ));153 root->addChild(createAxis(osg::Vec3(0.0,0.0,0.0),osg::Vec3(0.0,0.0,1000.0),numReps ));148 // int numReps = 3333; 149 int numReps = 10; 150 root->addChild(createAxis(osg::Vec3(0.0,0.0,0.0),osg::Vec3(1000.0,0.0,0.0),numReps,osg::AutoTransform::ROTATE_TO_CAMERA,"ROTATE_TO_CAMERA")); 151 root->addChild(createAxis(osg::Vec3(0.0,0.0,0.0),osg::Vec3(0.0,1000.0,0.0),numReps,osg::AutoTransform::ROTATE_TO_SCREEN,"ROTATE_TO_SCREEN")); 152 root->addChild(createAxis(osg::Vec3(0.0,0.0,0.0),osg::Vec3(0.0,0.0,1000.0),numReps,osg::AutoTransform::NO_ROTATION,"NO_ROTATION")); 154 153 155 154 return root;
