Map a camera angle to a Sun position in Revit

Map a camera angle to a Sun position in Revit

Anonymous
Not applicable
5,432 Views
22 Replies
Message 1 of 23

Map a camera angle to a Sun position in Revit

Anonymous
Not applicable

I need to produce a set of 3D views for Sun Analysis. The angle of the camera should be equal to the angle of the sun to be able to get views with not shadows. How can I map the camera angle with the sun position? Please refer to the attachment for your reference

 

0 Likes
Accepted solutions (1)
5,433 Views
22 Replies
Replies (22)
Message 2 of 23

ToanDN
Consultant
Consultant
What is the point of producing the sun analysis views if they don't show shadows?
0 Likes
Message 3 of 23

Anonymous
Not applicable

It seems to be a new requirement for Councils in Australia to verify the sun on each unit along


@ToanDN wrote:
What is the point of producing the sun analysis views if they don't show shadows?


the year.

0 Likes
Message 4 of 23

Viveka_CD
Alumni
Alumni

Hi @Anonymous

 

To orient the sun to match the orientation of the view, select Relative to View. Or, to orient the sun to match the orientation of the model, clear Relative to View.

 

See screenshot below

sun settingssun settings

Hope that is what you are looking for. Let me know if you have additional questions.

 

Please select the Accept as Solution button if my post solves your issue or answers your question. Likes welcome!

 

Regards,

 

 

 

Message 5 of 23

Anonymous
Not applicable

Thanks Viveka for your answer. Your solution moves the sun to the camera position.

What I need is to do the opposite: move the camera to the sun position.  Once I set up all my standard sun settings(Spring Equinox, Autumn Equinox, Summer Solstice, Spring Equinox...) I would like to generate a camera view placed in the same position of the sun. Can I do it in Revit? 

0 Likes
Message 6 of 23

Viveka_CD
Alumni
Alumni

Hi @Anonymous

 

I think you can achieve this by a solar study

Let me know if this helps!

 

Regards,

 

0 Likes
Message 7 of 23

loboarch
Autodesk
Autodesk
Accepted solution

There is not a way to automate the position of the camera. You would need to manually position the camera to match the position of the sun. The camera is not however set up to exactly give you feedback about its position like this. You would need to set up some model line/reference planes to help you get the positioning correct.



Jeff Hanson
Principal Content Experience Designer
Revit Help |
Message 8 of 23

revituser014RXCA
Community Visitor
Community Visitor

Hi,

 

I too also have the same problem, looking at the model from the sun's perspective.  Can you explain how I can achieve this?  How do I set up the model lines/ reference plane to make sure it's correct?  

0 Likes
Message 9 of 23

alexlj
Enthusiast
Enthusiast

haha, I am looking for this and I am from Australia too. Looks like the rest of the world doesn't really consider much about shadowing.

 

So there isn't a solution. I suppose have to export to Sketchup or Rhino

Message 10 of 23

lucdoucet_msdl
Advisor
Advisor

@alexlj and @Anonymous,

 

This seems a job for Dynamo which has nodes for obtaining the sun settings of a 3D view then manipulating the orientation of the view to match. You could try posting your problem to the Dynamo forums.

 

In this scenario, you would set the 3D view sun settings by date and time and then run the dynamo script would read these and set the view orientation accordingly.


Good luck,

-luc

P.S. Here are some of the nodes from the Synthetic package in question and where I fail to move forward:

 

What is missing is a method to convert the sun vector to a ViewOrientation3D object. It is discussed in the following blog post. 

https://thebuildingcoder.typepad.com/blog/2013/04/setting-up-your-vieworientation3d.html

 

 

Message 11 of 23

lucdoucet_msdl
Advisor
Advisor

@Anonymous 

 


. How can I map the camera angle with the sun position? 

 


A manual process for orienting the 3d orthographic view to the sun position would be as follows:

 

In a 3d orthographic view:

  1. Turn on the shadows and sun path to on;
    lucdoucet_msdl_0-1613323706805.png

     

  2. Set the sun settings to the date and time of the required view (by either clicking the blue date and time on the graphic or thru the sun parameters in the properties dialogue;
    lucdoucet_msdl_1-1613323758117.png

     

  3.  Rotate the 3D view (ideally with the Shift-Scroll button on the mouse) and line up the Sun globe with the intersection point of the N/S and E/W axis of the sun path graphic.
    lucdoucet_msdl_2-1613323877083.png

     

You will then note that all the sun cast shadows have disappeared as they are completely hidden by the geometry that is casting them on the objects in the background.

Quick and precise enough for a view to be printed and you can turn off the shadows and sun path to make sure no one takes a magnifying glass to the image.

 

-luc

Message 12 of 23

lucdoucet_msdl
Advisor
Advisor

@alexlj 

 

Got it to work in Dynamo. Here's the script and a screen cast for using it.

 

  1. Open a 3D orthographic view;
  2. Set the time and date for the view;
  3. Run the Dynamo script.

-luc

SetOrthographicToSunOrientation_20210214.png

 

Message 13 of 23

MariangelaM
Participant
Participant

I will try it and I will comeback to you! Thanks!!!

0 Likes
Message 14 of 23

lucdoucet_msdl
Advisor
Advisor

@revituser014RXCA 

 

An approximate and manual solution as well as a dynamo scripted solution have been posted if you are still interested.

 

Regards,

 

-luc

0 Likes
Message 15 of 23

lucdoucet_msdl
Advisor
Advisor

Screencast link added.

 

Dynamo script to set the Orthographic view orientation to the Sun position 


Don't know why it doesn't show up in the message.

 

-luc

0 Likes
Message 16 of 23

Sharon-Zhang
Explorer
Explorer

Luc,

 

thank you for sharing dynamo script. I missed some dynamo packages. can you kindly advised. Thank you.

 

Sharon-Zhang_0-1613818442400.png

 

 
0 Likes
Message 17 of 23

lucdoucet_msdl
Advisor
Advisor

@Sharon-Zhang.

 

All your missing nodes are from the Synthetic package.

 

Good luck,

 

-luc

0 Likes
Message 18 of 23

Sharon-Zhang
Explorer
Explorer

Thank you Luc.

 

actually I figure out using only python to align view direction with sun. 

herewith script to whoever still interest in, and it base on pyrevit platform.

sorry not sure how to attach file. 

Sharon-Zhang_0-1614033262211.png

 

Message 19 of 23

Anonymous
Not applicable
Hi Luc,

Just that when I update the true North angle, this does't work anymore. Could you please let us know how to adjust for it to work with this? Thanks.

Jaime
0 Likes
Message 20 of 23

lucdoucet_msdl
Advisor
Advisor

@Anonymous 

 

You are correct, I realize that the dynamo script is aligning the view with respect to the project orientation and not the true north. My mistake was testing it when the true north and project norths were aligned.

 

To adjust for this, the script must read the angle deviation from north parameter in the project base point, then rotate the vector "ForwardDirection" in the "ViewOrientation3d.ByEyeUpForwardDirections" node about the "Z" axis by that amount before calculating the "UpDirection" (See arrow below)

 

lucdoucet_msdl_0-1620738288899.png

 

The node for the deviation between true and project north is called "Coordinates.ProjectRotation".

 

Here's a revised version for you to test.

 

-luc