Closed IanMaquignaz closed 1 year ago
Proof:
Error case:
>>> n = 1024
>>> e = envmap.EnvironmentMap(n, 'skyangular')
>>> u = np.linspace(0,n-1, n)
>>> w_x, w_y, w_z, w_v = e.world2world(u/n, u/n)
>>> p_u, p_v = e.world2pixel(w_x, w_y, w_z)
>>> np.abs(u - p_u).sum()
3.0
Correct case:
>>> n = 1024
>>> e = envmap.EnvironmentMap(n, 'skyangular')
>>> u = np.linspace(0,n-1, n)
>>> w_x, w_y, w_z, w_v = e.pixel2world(u, u)
>>> p_u, p_v = e.world2pixel(w_x, w_y, w_z)
>>> np.abs(u - p_u).sum()
0.0
Thank you!
resolves #31
+-> added pixel2world() +-> added world2pixel() +-> fixed error in sunPosFromEnvmap()