Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have a simple 3D engine and I want to make a isometric(dimetric) game, but where tiles are not real 3D planes, but 2D images like this one:
Tile image As I understand this tile is drawn in dimetric 1:2 projection But I can't get right camera angles in order to have view, where all given tiles would fit perfectly by pixel. After reading this page I've tried rotating camera relatively to itself by x=26.565deg y=45deg but that gave me bad result.
enter image description here
It's clearly visible, that tiles don't fit together nicely.
I've tried different value, by just handpicking them, and the closes one was x:30deg y:45deg angles. enter image description here But there is a problem with gaps between tiles. It maybe somehow related to problem, that I don't know how to calculate length of one tile edge in world space, currently when I put tiles in scene I space them by 45units, which also is a handpicked value.

You would ask, "Why do I try to do this in 3D engine?". I want to mix 2D tile and object sprites with simple 3D objects in one game. I've already did isometric terrain with 2D engine, where everything can be simply calculated and doesn't need to position a camera.

share|improve this question
    
I love style of the "Isometrica" from the link you posted! Reminds me of The Rollercoaster Tycoon! Try looking for some clone of the game with opensource code. Might come in handy :) facepunch.com/showthread.php?t=1149898 –  Mikolaj Marcisz Jul 7 '13 at 15:24
    
Dimetric projections actually don't have a "right" measure. You just have to have to axis with equal angles, with the other being any angle you want. BUT if you want like the older "isometric" 2D games, with 2:1 ratio, you can achieve this with Yaw: 45°, Pitch: 35.264°, If you want the precise angle of pitch, you can get it by arctan(sin(45°)) –  Gustavo Maciel Jul 7 '13 at 16:39
    
Btw follow the wikipedia link, it even teach how to make the rotation matrix for this. –  Gustavo Maciel Jul 7 '13 at 16:40
    
Gustavo Maciel, I know that there is infinite variation of dimetric, but I'm looking for one that would fit my given tile sprites. 35.264deg gives way too bad results, and as I understand this angle is for TRUE isometric projection, it described here gandraxa.com/isometric_projection.xml . –  Denis Narushevich Jul 7 '13 at 19:45
add comment

1 Answer

up vote 0 down vote accepted

Ok, got it!) It turns out that 30deg angle is perfect for this, I can't prove it matematicaly but it works. Problem with gaps also dissappeared, when I spaced tiles with distance of 45.261 between each other. 1/2LENGTH_OF_TILE_SPRITE_32PX * (1/Cos(45)) = 45.261.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.