Jump to content
  • Advertisement
Sign in to follow this  
m_waddams

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.

If you intended to correct an error in the post then please contact us.

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.)

pool.gif

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.

correct.gif

 

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

wobble.gif

 

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

rotateview.gif
 

Spindizzy (Canvas)
Spindizzy (WebGL)

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

Share this post


Link to post
Share on other sites
Advertisement

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 this post


Link to post
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).
Edited by Milton Waddams

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!