Advertisement

Isometric using full D3D math...

Started by August 20, 2000 06:26 AM
10 comments, last by Christiaan 24 years, 4 months ago
hello, I''m trying to make an isometric engine using full D3D (world) and setting up the camera in a fixed 45 degrees angle to create the looks of an isometric engine view only currently the tiles farther away from the camera (top of screen) look smaller then the ones closer and with an isometric engine all tiles on the screen are the same size, so how do I set D3D/the camera that all tiles are the same size on screen??? chris
I take it you have not played Diablo 2 then?

The effect you are talking about is great in that game, shame it runs so slow though. Instead of looking for the othoganal (sp?) view controls play around with it a bit more, there''s a game out there with the perspective isometric view already, and IMHO i think this is going to be the next stage in the Isometric game evelution.
When I find my code in tons of trouble,Friends and colleages come to me,Speaking words of wisdom:"Write in C."My Web Site
Advertisement
I have played diablo 2,

but I wanted to know how to achieve that, I got an isometric looking engine using full 3D math (D3D) with an static 45 degree angle camera, but the farther my tiles are away from the camera the smaller they become, which I do not want I want all tiles on screen to be excatly the same size...is this possible using a 3D world...and how I do that?

chris
It sounds like you need to setup an orthogonal projection matrix.
Easiest way is to use the D3DXMatrixOrthoLH() function, since DX uses a
left-handed coordinate system. You don''t want D3DXMatrixOrtho() because
that gives you a right-handed one. Look it up in the SDK docs. You also
need to include the d3dx.lib file to call any d3dx function.

To get your view matrix (fixed camera) in the correct position, start at
any distance from the origin on the x-axis, like (1,0,0) and rotate it to
45,135,225,315,etc.. degrees around the y-axis. You can put it in any
quadrant you want. This will make a cube at the origin look as if it has
equal left-right sides. To get it isometric, you have rotate it up 30 degrees
from the xz plane.

And if you haven''t already, you will probably want to create and attach
a Z-buffer surface so everthing is drawn back to front correctly. If you
use a 16-bit Z-buffer, you should limit your z-range since you can only
work with (2^16) 65536 possible depths. But it should be sufficient.

This should be enough info to get anyone started. Next step would
probably be terrain rendering. Fun with quad and octrees.
yeah, anonymous is right on, you have the projection view set up as perspective correct and not orthogonal.
I should probably add that you should only do this if you want to work
with a true 3D camera and true 3D objects. If you want to fake the
camera projection and be able to draw tiles using screen coordinates,
you should use D3DTLVERTEX polygons drawn isometrically. No need for
complicated quad or octrees or anything else like that.
Advertisement
If you want the game to look like civ2 where the tiles at the top are the exact same size as those at the bottom then you have to make the camera looking Straight Down on the tiles, and then just like in civ2, instead of making square tiles and looking at them from an angle (thus they look diamond shaped), you make the tiles themselves diamond shaped and look straight down on them.

Possibility
Well that certainly is an idea Martyr thanks, I don''t want to be difficult, but if I put the camera looking Straight Down on the tiles, I won''t be able to see much of a 3D view and I want to use square tiles that appear to look like diamonds ''cause of the camera angle...is this all possible with the same tile sizes everywhere on the screen, or am I now asking for the impossible?

chris
It is posible to do, I''m not sure how you would set it up, but the anon poster already suggested how to do it.

I think the perspective isometic view looks good, as long as the engine does not drop below about 20 frames a second.
When I find my code in tons of trouble,Friends and colleages come to me,Speaking words of wisdom:"Write in C."My Web Site
I don''t recommend using TLVERTEX to render your tiles, because then you lose all transformation and lighting functionality that makes Direct3D even worth using. The exception would be if you wanted to transform your geometry manually, which might be a good option for you since you''re trying to achieve something different than what D3D was designed to handle.

I''ve never used D3DX because it isn''t supported in VB, but that sounds like a good idea to me. I''m not familiar with any matrices that produce an orthogonal field-of-view, but if I find one, I''ll let you know.

GDNet+. It's only $5 a month. You know you want it.

This topic is closed to new replies.

Advertisement