You are not logged in.

Dear visitor, welcome to Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.


Thursday, May 30th 2019, 12:10am

Map cartesian coordinates on the pano face image to sperical coordinates on the panorama

I have a panorama of size 5376x2388. Using the krpano tool, I am able to extract 6 faces of size 1712x1712. If I have a coordinate on one of the faces wrt to the top left of the image, how do I go about mapping those (x, y) coordinates into spherical (h, v) coordinates that can be used on the krpano javascript interface?


Thursday, May 30th 2019, 12:30am

given a 3D cube with a pixel size of 1712, with x or y or z being +1712 or -1712
and the other two axes being the pixel coordinates on that plane

h = Math.atan2(x, z)
v = -Math.atan2(-y, Math.sqrt(x * x + z * z))



Thursday, May 30th 2019, 5:55pm

Thanks bruh. *thumbsup* *thumbsup*

Took me some time to figure it out, but you are a life saver.


Thursday, May 30th 2019, 7:19pm

welcome to the forum :)

Similar threads