forked from speed-dreams/speed-dreams-code
OSG : work on sun
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@5307 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 3a5f17e4aa27b21645c1a8a0f655cf123fcbfe8c Former-commit-id: 8914ca05b43fc09ea110290f3fa0dfa13aca12b1
This commit is contained in:
parent
0d867d84a3
commit
1d9b51690f
1 changed files with 4 additions and 4 deletions
|
@ -349,10 +349,10 @@ bool SDSun::reposition( osg::Vec3d p, double sun_angle)
|
||||||
osg::Matrix R = T1*DEC*RA;
|
osg::Matrix R = T1*DEC*RA;
|
||||||
sun_transform->setMatrix(R);
|
sun_transform->setMatrix(R);
|
||||||
|
|
||||||
osg::Vec4f pos = R*osg::Vec4f(0.0,0.0,0.0,1.0);
|
osg::Vec4f pos = osg::Vec4f(0.0,0.0,0.0,1.0)*R;
|
||||||
sun_position = osg::Vec3f(pos._v[0],pos._v[1],pos._v[2]);
|
sun_position = osg::Vec3f(pos._v[0],pos._v[1],pos._v[2]);
|
||||||
|
|
||||||
GfOut("Sun Position : %f - %f - %f\n", pos._v[0], pos._v[1], pos._v[2]);
|
GfOut("Sun Position : %f %f %f %f %f\n", pos._v[0], pos._v[1], pos._v[2],sun_dist,pos.length());
|
||||||
|
|
||||||
osg::Vec3f upos = osg::Vec3f(sun_position);
|
osg::Vec3f upos = osg::Vec3f(sun_position);
|
||||||
osg::Vec3f uplan = osg::Vec3f(sun_position._v[0],0.0,sun_position._v[2]);
|
osg::Vec3f uplan = osg::Vec3f(sun_position._v[0],0.0,sun_position._v[2]);
|
||||||
|
@ -360,9 +360,9 @@ bool SDSun::reposition( osg::Vec3d p, double sun_angle)
|
||||||
uplan.normalize();
|
uplan.normalize();
|
||||||
|
|
||||||
sun_angle_to_scene = acos(upos*uplan);
|
sun_angle_to_scene = acos(upos*uplan);
|
||||||
sun_angle = 1.05; //sun_angle_to_scene;
|
sun_angle = sun_angle_to_scene;
|
||||||
|
|
||||||
GfOut("Sun Angle = %d\n", sun_angle);
|
GfOut("Sun Angle = %f\n", sun_angle);
|
||||||
|
|
||||||
// Suncolor related things:
|
// Suncolor related things:
|
||||||
if ( prev_sun_angle != sun_angle )
|
if ( prev_sun_angle != sun_angle )
|
||||||
|
|
Loading…
Reference in a new issue