title: How to project a spherical map onto a sphere / cube:  "Equirectangular to cubic"
body: <p>UPDATE:
  I found that, <a href="http://os.ivrpa.org/panosalado/wiki" rel="nofollow noreferrer">http://os.ivrpa.org/panosalado/wiki</a> , has an implementation in java. Anyone who has something similar in c or c++?</p>
  
  <p>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.</p>
  
  <p><img src="https://i.stack.imgur.com/ZH9Op.jpg" alt="panorama"></p>
  
  <p>I tried <a href="http://krpano.com/docu/tutorials/quickstart/#top" rel="nofollow noreferrer">http://krpano.com/docu/tutorials/quickstart/#top</a> 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). </p>
  
  <p>[Back,Down,Front,Left,Right,Up]</p>
  
  <p><img src="https://i.stack.imgur.com/DfpRB.jpg" alt="Back">
  <img src="https://i.stack.imgur.com/4uNuc.jpg" alt="Down">
  <img src="https://i.stack.imgur.com/FPJeM.jpg" alt="Font">
  <img src="https://i.stack.imgur.com/KIJer.jpg" alt="Left">
  <img src="https://i.stack.imgur.com/YWKbf.jpg" alt="Right">
  <img src="https://i.stack.imgur.com/fzj18.jpg" alt="Up"></p>