algorithmic modeling for Rhino
Hi Dalia,
i don't know DIVA but it needs only 3 simple lines to set/activate the sun in rhinocommon(Rhino5):
Place a c# component on your gh canvas and try this:
Rhino.Render.Sun s = doc.Lights.Sun;
s.SetPosition(DateTime.Now, lat, lon);
s.Enabled = true;
Instead of DateTime.Now you can set DateTime variable to your specific day and time.
lat and lon you should get directly from Diva somewhere?
hope this helps
cheers FF
Hi Frank,
Thanks for your response, I am sorry but I'm not familiar with scripting, I am getting an error message of not recognizing the sun namespace.... could you please tell me where exactly in the C# script do I past this code or send me a screenshot of it?? I am also working on Rhino4, will this script still be working on it?
Thanks a lot for your help!
Dalia.
Hi Dalia,
Check the definition in this post by Luis:
http://www.grasshopper3d.com/profiles/blogs/control-rhino-sun-syste...
Thanks Mostapha, but this wouldn't work on Rhino4..
Hi Dalia, hm i'm sorry you're posting in the scripting section of the forum, so i thought this is what you need...
The code above is working and you did everything right. The sun namespace is not recognized in R4 because there is no...only in Rhino 5
The definition from Luis uses the same techniques as the code above...but if you have only R4 you might have to do a workaround with some Directional Light.
Is there a way to get the Sun direction as a Vector from DIVA? this might help us a lot...
Cheers
FF
Hi Frank, Sorry it took me a while to gt the answer, yes Sun vector can be extracted from another DIVA component, Solar component, attached the link that describes it, can this anyhow help connecting to the renderer??
yes that's very good if you can't or don't want to switch to Rhino 5. So with the vector i can do a short script for you, that places an infinite light in 3d space. The infinite light is comparable to the sun object in Rhino5 just that it hasn't some features.
Do you use Vray or any other render? Do you still need the solution for Rhino 4 with the infinite light?
Cheers FF
Hi Dalia,
i've attached a gh file, which allows you to link an existing light (of any kind) to gh and connect your vector output to this light. The light will be set to directional light (Sun light) and the direction will be updated each time the vector changes.
You can set all the properties for your light up in Rhino and then just change the direction with grasshopper.
Hope this helps.
Best regards
FF
P.S: Create any kind of Rhino 4 light. Copy the ID from this light object (you find it under the selected object's properties dialog by clicking on "Details...").
Hi Dalia, i recieved a reply that has been deleted afterwards...so did it work? or do you have still problems with that error?
Hi Frank,
I tried to include Sun light command in Rhino, but i wasn't able to find it,do I use directional light?? if yes, how do I set it to work as a sunlight???
Best,
Dalia.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by