Changeset 295 for osgVisual/trunk/src
- Timestamp:
- Jun 6, 2011, 11:16:54 PM (13 years ago)
- Location:
- osgVisual/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/trunk/src/sky_Silverlining/skySilverLining_skyDrawable.cpp
r293 r295 67 67 atmosphere->GetAmbientColor(&ra, &ga, &ba); 68 68 atmosphere->GetSunOrMoonColor(&rd, &gd, &bd); 69 atmosphere->GetSunOrMoonPosition(&x, &y, &z); 69 //atmosphere->GetSunOrMoonPosition(&x, &y, &z); 70 atmosphere->GetSunOrMoonPositionGeographic(&x, &y, &z); 71 70 72 71 73 direction = osg::Vec3(x, y, z); … … 79 81 direction.normalize(); 80 82 81 //OSG_NOTIFY(osg::ALWAYS) << "Light Vector: X:"<<direction.x()<<" Y:"<<direction.y()<<" Z:"<<direction.z() << std::endl; 82 util::AddCylinderBetweenPoints(osg::Vec3d(0,0,0), direction , 10000.0, 15000000.0, osg::Vec4d(1.0, 1.0, 0.0, 1 ), sceneRoot); 83 //double cx,cy,cz, lat, lon, height; 84 //util::getWGS84ofCamera( _view->getCamera(), sceneRoot, lat, lon, height ); 85 //util::calculateXYZAtWGS84Coordinate(lat, lon, 0, sceneRoot, cx, cy, cz); 86 //util::AddCylinderBetweenPoints(osg::Vec3d(cx,cy,cz), direction*-15000000 , 500.0, osg::Vec4d(1.0, 1.0, 0.0, 1 ), sceneRoot); 87 //util::AddCylinderBetweenPoints(osg::Vec3d(0,0,0), direction*-15000000 , 500.0, osg::Vec4d(0.0, 1.0, 1.0, 1 ), sceneRoot); 88 83 89 84 90 light->setAmbient(ambient); 85 91 light->setDiffuse(diffuse); 86 //light->setSpecular(osg::Vec4(0,0,0,1));92 light->setSpecular(osg::Vec4(0,0,0,1)); 87 93 //light->setSpecular(osg::Vec4(1.0,1.0,1.0,1)); // Test 88 94 light->setPosition(osg::Vec4(direction.x(), direction.y(), direction.z(), 0)); -
osgVisual/trunk/src/util/visual_util.cpp
r293 r295 571 571 } 572 572 573 void util::AddCylinderBetweenPoints(osg::Vec3d StartPoint, osg::Vec3d EndPoint, float radius, float length,osg::Vec4d CylinderColor, osg::Group *pAddToThisGroup)573 void util::AddCylinderBetweenPoints(osg::Vec3d StartPoint, osg::Vec3d EndPoint, float radius, osg::Vec4d CylinderColor, osg::Group *pAddToThisGroup) 574 574 { 575 575 osg::ref_ptr<osg::Geode> geode = new osg::Geode; … … 580 580 osg::ref_ptr<osg::Material> pMaterial; 581 581 582 //height = (StartPoint-EndPoint).length(); 583 height = length; 582 height = (StartPoint-EndPoint).length(); 584 583 center = osg::Vec3( (StartPoint.x() + EndPoint.x()) / 2, (StartPoint.y() + EndPoint.y()) / 2, (StartPoint.z() + EndPoint.z()) / 2); 585 584
Note: See TracChangeset
for help on using the changeset viewer.