Sunposition 3D viewer

Hi folks!

Just made an app to visualize the sun position for a given location at a given time. Now it is super easy to export the house model from blender and share the interactive link anyone can acess without installing anything.

Live app:
Source: GitHub - elschilling/sunposition: Sun position 3D viewer


@elschilling Loved it, i thought the same idea with moon. Like crescent moon and all the variations. You should try with mon. And how much time you gave to this project?

1 Like

That’s a great approach tp visualizing the sky.

One small suggestion - I would generally start with the viewer in the northern hemisphere which is where 87% of the world population is located. I was initially surprised to see the axis of the sun angled to the north until I realized that your default position was in the southern hemisphere.

Also are you using UTC time? I was confused as to why the sun was not overhead at 12:00 hours, but suspect that is the reason.

If you are interested, I tried creating a similar kind of demo of the sky which includes the sun, moon and stars (at night). On the view tab, select “One Day”. Perhaps the program contains something useful that you can appropriate and use in yours.

As noted, one challenge I faced was matching the time to the view. I opted to use local time, but - rather than using exact time zones - simply divided the earth into 24 segments. Also, I ignored local seasonal adjustments like daylight savings time. Alternatively, instead of allowing the user to select the exact location, you could allow the user to select from a list of locations and you could compute exact information for each location.

I hope that helps.

1 Like

Nice one. If you could make it so that an openStreet map or other online maps with 3d models could be loaded in, maybe with an option for drawing custom polygons to simulate builds planned, than this would be greatly useful for normal users as well.

1 Like

Thanks @mtalha ! The main purpose of the app is to analyse the sun path in relation to the architectural project and easily share it with the client. But definitely see the moon would be a cool improvement. The suncalc library used to get the sun position provide methods to moon informations also, I think it wouldn’t be so hard to implement.

Very cool @phil_crowther !
I am from Brazil so happened that the default parameters are from here. I didn’t know this information about the population distribution, I will change it to a northern location so to attend the majority of users. This is my first time sharing code that I did with the world so these kind of issues are new for me :).

I liked your demo specially the first person view, I am also implementing an option to switch between cameras, from bird view to first person so that you can walk around and see the sun simulation from diferent perspectives!

Thanks for the feedback!

Thanks @Digi_Dyn ! There are a lot of possibilities for sure! For now I wanted to keep it simple focused on the main objective that in this case is to share the sun analysis with the client that is willing to build the house :slight_smile:

Now I am conflicted. The palm tree and tropical birds look so perfect for Brazil! And it is consistent with your use of O and L for West and East.

I’m glad you found my program useful. When designing the first person view, I was visualizing the viewer on a platform similar to the one you have created. FYI - the blue sky is just a blue sphere that I made partially transparent at dusk/dawn and did not draw at night. Of course, the sun, moon and light source had to be within the sphere.

I believe that, in other posts, I have discussed the subject of moving your camera to different locations. It is actually quite simple in three.js.

If you are so inclined, it seems that you can take this project in a couple of different directions. You could add more celestial features like the moon. Or you could make this an architectural aid - since the location of the sun is very important in determining the direction a house (and solar panels) should be positioned. One of your viewpoints could be from inside the house looking out the windows.

You could even go further and try to estimate the effect of the sun and different types of windows on energy costs. This is bound to become a bigger issue as temperatures and energy costs increase in the future.