# Isometric projection angles...

This topic is 923 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi everyone. I'm trying to create a 2D spinning ball, but in Isometric projection.

I'm using the following code:
http://www.angryoctopus.co.nz/java4k/PoolTest.html
which seems to work fine for top down view. (If Java doesn't work for you, this is my HTML5 test: Pool Press X to toggle aXes display.)

Now I try to use this same code for my Isometric engine. So I rotate by 45 and 30 (yaw/pitch).
It seems to work fine, as long as my ball's axes are World axes aligned.

If they're not, I'm not sure what is happening.

Also, when I rotate my view, what would be the correct rotation?

Press H for help. (A Aabb,  W Wireframe, X aXes, 1/2 Rotate).

##### Share on other sites

The projection from the basic view direction looks fine to me. Although I do notice in the Spindizzy example, you don't appear to be applying any friction against the ball spinning freely about the world vertical axis, which might be cause the appearance of wobble.

As for rotating the view... you're just rotating the ball around the view Z axis. You need to rotate the projection of the ball around the world vertical axis instead. You can tell this is what is happening by leaving the ball stationary with the number at the top. Rotating the view should leave the number at the top from all four directions, but instead you're rotating the ball as though looking straight down on it (where the view and world vertical axes are parallel).

##### Share on other sites

'As for rotating the view... you're just rotating the ball around the view Z axis. You need to rotate the projection of the ball around the world vertical axis instead. You can tell this is what is happening by leaving the ball stationary with the number at the top. Rotating the view should leave the number at the top from all four directions, but instead you're rotating the ball as though looking straight down on it (where the view and world vertical axes are parallel).'

Agreed, that's actually what I'm doing. But it doesn't look right. What should be the actual angles for a dimetric projection?
When I rotate my view, I rotate by 90 degrees, so I rotate the ball by another 90 degrees (around the same 'yaw' axis I used for the original view).

##### Share on other sites

Right, but your viewing angle is not aligned with world axes. You need to recalculate the ball's "display" rotation based on its "physics" rotation. Assuming in your Spindizzy example that +X is down-right, +Y is up-right, and +Z is straight up, your camera is 60° around X and 45° around Z away from looking straight down (sign will vary based on left- or right-handedness of rotation). That Z rotation should be increased or decreased by 90° each time you rotate the camera.

For minimal change from your current codebase and process... each frame you should make a COPY of your ball's physics rotation, and apply a view rotation to that to match it up to your viewing angle, and then render using that apparent rotation instead of the ball's actual rotation.

1. 1
2. 2
3. 3
4. 4
Rutin
13
5. 5

• 24
• 10
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633695
• Total Posts
3013373
×