My latest project has a small square map (a flat 3d mesh) that can be rotated. What I would like to do is now be able to allow the user to change the view from side on to top view (and everything inbetween). In theory all I have to do is rotate around the X axis.
This works fine. I hit a problem though when I've rotated the map (rotated around the Y axis). If I've turned the square 45 degrees around Y then try to rotate it around X, I expect to see the corner of the square that's now facing me go straight up and over. Instead it rotates based on the original x axis and not what I'm now looking at (ie, it seems to rotate from right over to left).
Does anyone have any ideas on how to have it rotate how I'd like it to? (ie. relative to how it's now seen from the camera?)
This works fine. I hit a problem though when I've rotated the map (rotated around the Y axis). If I've turned the square 45 degrees around Y then try to rotate it around X, I expect to see the corner of the square that's now facing me go straight up and over. Instead it rotates based on the original x axis and not what I'm now looking at (ie, it seems to rotate from right over to left).
Does anyone have any ideas on how to have it rotate how I'd like it to? (ie. relative to how it's now seen from the camera?)