Changeset 5786 for OpenSceneGraph/trunk/examples/osgshadow/osgshadow.cpp
- Timestamp:
- 12/01/06 16:19:21 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgshadow/osgshadow.cpp
r5785 r5786 150 150 while (arguments.read("--noUpdate")) updateLightPosition = false; 151 151 152 bool createBase = false; 153 while (arguments.read("--base")) createBase = true; 154 152 155 bool doShadow = true; 153 156 while (arguments.read("--noShadow")) doShadow = false; … … 175 178 model->accept(cbbv); 176 179 osg::BoundingBox bb = cbbv.getBoundingBox(); 180 181 if (createBase) 182 { 183 osg::ref_ptr<osg::Group> newGroup = new osg::Group; 184 newGroup->addChild(model.get()); 185 186 osg::Geode* geode = new osg::Geode; 187 188 osg::Vec3 widthVec(bb.radius(), 0.0f, 0.0f); 189 osg::Vec3 depthVec(0.0f, bb.radius(), 0.0f); 190 osg::Vec3 centerBase( (bb.xMin()+bb.xMax())*0.5f, (bb.yMin()+bb.yMax())*0.5f, bb.zMin()-bb.radius()*0.1f ); 191 192 geode->addDrawable( createTexturedQuadGeometry( centerBase-widthVec*1.5f-depthVec*1.5f, 193 widthVec*3.0f, depthVec*3.0f) ); 194 newGroup->addChild(geode); 195 196 model = newGroup.get(); 197 } 198 199 // get the bounds of the model. 200 cbbv.reset(); 201 model->accept(cbbv); 202 bb = cbbv.getBoundingBox(); 177 203 178 204 osg::ref_ptr<osg::Group> group = new osg::Group; … … 204 230 lightpos.set(0.5f,0.25f,0.8f,0.0f); 205 231 } 232 206 233 207 234
