New blog! After over a year of absence, I figured I’d spin this baby back up. In other news, here’s how to calculate v0‘s smooth normal in UE4:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
FVector GetSmoothNormal(FVector v0, FVector v1, FVector v2, FVector v3, FVector v4) { FVector v12 = FVector(); FVector v23 = FVector(); FVector v34 = FVector(); FVector v41 = FVector(); FVector normal = FVector(); v1 = v1 – v0; v2 = v2 – v0; v3 = v3 – v0; v4 = v4 – v0; v12 = v1 ^ v2; v12.Normalize(); v23 = v2 ^ v3; v23.Normalize(); v34 = v3 ^ v4; v34.Normalize(); v41 = v4 ^ v1; v41.Normalize(); normal = v12 + v23 + v34 + v41; normal.Normalize(); return normal; } |
And here’s the discrete radiosity equation:
B_{i}=E_{i}+\rho_{i}\sum\limits _{i=1}^{n}F_{ij}B_{j}
where F_{ij} is the geometrical view factor for the radiation leaving j and hitting patch i. In truth, this has been a test. I just wanted to make sure that LaTeX and syntax highlighting work. Cheers!