mayakraft / Panorama

Spherical panorama view, iOS
MIT License
649 stars 135 forks source link

Tilting Sphere and Changing Spin Axis #50

Open Source-41 opened 8 years ago

Source-41 commented 8 years ago

Is it possible to change the spin axis of the sphere and tilt the sphere to that spin axis? Example would be tilting north and south pole 5 deg forward and then spinning on the new north and south pole.

mayakraft commented 6 years ago

So sorry for missing this! If I understand it correctly I was able to do this by adding one rotate command before the glMultMatrixf(_attitudeMatrix.m) line, around line 200.

glRotatef(5, 0, 0, 1);  // 5 degrees around z axis, can also do x axis
glMultMatrixf(_attitudeMatrix.m);

this makes it so when we pan around our Y axis, the world rotates around its new 5 degree axis, so the mapping is off by 5 degrees