kekscom / osmbuildings

OSM Buildings Classic 2.5D
http://osmbuildings.org
BSD 2-Clause "Simplified" License
505 stars 140 forks source link

Shadow direction and Orientation #43

Closed neogeomat closed 11 years ago

neogeomat commented 11 years ago

According to the principle of Hill Shading ( 3d visulization of terrain/ground). For a good model: The sun should be projected From North West corner and the viewer should be assumed to be in South East corner.

This means that the top of building should be north of the foot and the top of the shadow should be south of the foot.

The formula you have used will give the sun's azimuth in south (which is the true case). Hence the shadow is to north of foot of building, due to this the buildings have a pseudoscopic effect (top appears as bottom).

kekscom commented 11 years ago

Could you point me to a place on http://osmbuildings.org or send a screen shot?

neogeomat commented 11 years ago

amritkarma.github.io, i just enabled shadow, might take some time to show up

kekscom commented 11 years ago

Hi, Ok, that helped explaining your use case. The only way to enforce the shadow direction is through setting date and time. As there is no way to fake position for suncalc, depending on where and when this could have helped with your desired sun direction.. As I don't see it as part of the core lib, you probably need to adapt the source code a bit.