Solar potential analysis with shadowing effect
Illustrative examples of surfaces:
1.Surfaces From CityGML Wall surface 1: Wall surface 2:
Wall surface 3: Wall surface 4: Wall surface 5:
2. Calculate Surface Normal Normal vector: cross product of distance vector of two edges of wall surfaces Vertices: (X 1,Y 1,Z 1 ); (X 2,Y 2,Z 2 ); (X 3,Y 3,Z 3 ); (X 4,Y 4,Z 4 ) Edges: (X 2 - X 1,Y 2 - Y 1,Z z - Z 1 ); (X 3 – X 2,Y 3 – Y 2,Z 3 – Z 2 ); Wall surface 1: ( 0, , 0 ) Wall surface 2: ( 0, , 0 ) Wall surface 3: ( 0, , 0 ) Wall surface 4: ( 0, , 0 ) Wall surface 5: ( , , 0 )
3. Calcualte Plane Equation Surface normal = ai + bj + ck Origin of points = (X 0,Y 0,Z 0 ) Equation of Plane = ax + by + cz - d Substitute I by (x - X 0 ) ; j by (y - y 0 ) ; k by (z- z 0 ) in surface normal D = a X 0 + bY 0 + cZ 0 Wall surface 1: Wall surface 2: Wall surface 3: Wall surface 4: Wall surface 5:
W RORO S N AZIMUTH ALTITUDE E RDRD l 4.Calculate Sun path
4.SunRay orientation and ray path Sun path find out by elevation and azimuth through cartesian coordinate system sun ray origin = (X 0, Y 0, Z 0 ) : a typical point (viewpoint) away from surfaces in the direction of sun l – length of sample vector sun ray direction = (X, Y, Z) : sample vector starting at sun ray origin Components of sample vector X = X 0 + dX Y = Y 0 + dY Z = Z 0 + dZ Dx = l *sin(azimuth)cos(elevation) Dy =l* cos(azimuth)cos(elevation) Dz = l*sin(elevation)
Dist'= Dist *cos(Elev ); z = Dist *sin(Elev ); x = Dist'*cos(Azimut); y =-Dist'*sin(Azimut);
Z sorting: constructing the view-port We need X,Y,Z axis vectors and O origin position 1. view.Z=Ray.Dir // ray direction 2. view.Y=NEH.Z // NEH up vector 3. view.X=view.Y x view.Z // cross product make view.X axis perpendicular to Y ansd Z 4. view.Y=view.Z x view.X // make all three axises perpendicular to each other 5. view.O=ground position - (distance*Ray.Dir);
5.Ray plane intersection WALL1 WALL2 R O (X 0, Y 0, Z 0 ) R D (X, Y, Z) t1t1 I 1 (X, Y, Z) I 2 (X, Y, Z) t t2t2 Pn Where, Pn – Plane normal t - Distance of the ray from origin R O (X 0, Y 0, Z 0 ) - Ray origin R D (X, Y, Z) – Ray direction I (X, Y, Z) – Intersection point = [X 0 + X * t, Y 0 + Y * t, Z 0 + Z * t] (R 0 + R D * t). Pn + D = 0
Bounding Volume hierarchy:
5.Ray plane intersection Ray: R 0 + R D * t = I Plane: aX + bY + cZ + D = 0 D = aX 0 + bY 0 + cZ 0 (R 0 + R D * t). Pn + D = 0 t = Vo/Vd Where t equals the distance of the ray from origin in World Coordinates First calculate Vd = Pn * R(d) Where, If Vd = 0, Ray is parallel to the plane and no intersection occurs If Vd > 0,normal of the plane is away from the ray and the plane is to be culled And then,calculate Vo = - (Pn * R(o) + D) and find t = Vo/Vd Where, t < 0.0: behind Ro(no intersection) t > 0.0: infront of Rd Intersection point: (X i, Y i, Z i ) = [X 0 + X * t, Y 0 + Y * t, Z 0 + Z * t] Sort the surfaces based on the intersection point
6.Clip shadows on surfaces It’s the process of finding the exact part of a polygon (shadow) lying inside the view volume by Sutherland–Hodgman algorithm. Input 1: Subject Polygon Input2:Clip polygon Output: Intersection Region ml