Grasshopper

algorithmic modeling for Rhino

Rhino.Render.Sun.SunDirection versus member of Rhino.Render.Sun and accuracy

Where is the description of Rhino.Render.Sun.SunDirection?

I have written the very simple following script

private void RunScript(DateTime x, object y, ref object A, ref object B, ref object C, ref object D, ref object E)
{
  Rhino.Render.Sun theSun = Rhino.RhinoDoc.ActiveDoc.Lights.Sun;
  DateTime dt = theSun.GetDateTime(DateTimeKind.Local);
  A = dt;
  theSun.SetPosition(dt, theSun.Latitude, theSun.Longitude);
  Vector3d fVec = new Vector3d(theSun.Vector);
  Vector3d sVec = Rhino.Render.Sun.SunDirection(theSun.Latitude, theSun.Longitude, dt);
  D = fVec - sVec;
  B = fVec;
  C = sVec;
  E = "Latitude " + theSun.Latitude.ToString() + " - Longitude " + theSun.Longitude.ToString();
}

and B and C are never the same. I do not understand why. Can someone explains how SunDirection works or what is the best way to have the vector to the sun ?

Thanks

Serge

Views: 571

Replies to This Discussion

Is it from my computer and SunDirection & Sun.Vector are working fine for everybody else or nobody knows the answer? 

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service