How to project a spherical map onto a sphere / cube: “Equirectangular to cubic”

主宰稳场 提交于 2019-12-04 22:33:41

问题


UPDATE: I found that, http://os.ivrpa.org/panosalado/wiki , has an implementation in java. Anyone who has something similar in c or c++?

I have this panorama, an spherical map from google streetview, and want to map this on a sphere/cube. Below are some examples and illustrations, what i seek is a library that can do it, or some implementation guides.

I tried http://krpano.com/docu/tutorials/quickstart/#top that gives the results listed at the bottom. It illustrates what i want, but the rotation axis is off. I need to create the views of direct ahead and back, left and right. Ideal i would like to map it to the sphere and tell it what angles to extract (the orientation of the cube).

[Back,Down,Front,Left,Right,Up]


回答1:


You could do this easily in POV-Ray putting the camera in the middle of a sphere mapped with your texture. See image_map map_type 1 and e.g this example.

But really this is very easy to implement yourself, assuming the input images are some sort of cylindrical equidistant or equirectangular projection: for each (x,y) in the output image you are rendering, just use the inverse formulas to compute a (longitude,latitude) in the input image and interpolate/copy over a pixel value.



来源:https://stackoverflow.com/questions/9948583/how-to-project-a-spherical-map-onto-a-sphere-cube-equirectangular-to-cubic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!