d3d objects in iso engine

Started by
0 comments, last by Havana Smurf 23 years, 11 months ago
further to Brackets excellent tutorial on using D3D for ios 2d maps i just wanted to query a few things. 1) Drawing objects in game - is mapping 2d bitmaps (textures i should say) the best way to place objects on th e map? I dont suppose anyone has tried 3d objects? So instead of using Blt in ddraw to render your game characters on screen the general idea is to draw a quad and render the texture on the quad yes ? 2) Setting textures - in Brackets demo all the terrain squares use the same texture. So if u draw a grass tile next to a stone tile u have to change the SetTexture() (not sure the exact name of it) between rendering each tile yes ? 3) do collisions have to be done in 3d ? lastly but not leastly, does the engine render on a 45 degree yaw ? your input would b greatly appreciated because im really tossing up whether to follow this method for my 2d iso engine or just to stick with ddraw. andrew ''Once a smurf, always a smurf''
''Once a smurf, always a smurf''
Advertisement
I''m far from the end all expert and only just getting comfortable with d3d but hopefully these thoughts will help:

1)Yes, you can use Direct Draw in D3D. In truth, actually you have little choice as D3D sits on top of Direct Draw. For a little D3D trivia, in 7.0 textures are actually DDraw surfaces. However, while you can mingle blits with renders, MS documentation advises against it. It requires a big state change in you''re video card and can cause severe performance hits. 2D items, even "huds" and such should be rendered on 3D quads. Thankfully, with D3DTLVERTEX it really isn''t all that hard to do.

2)Actually you had it right. For 7.0 its LPDIRECT3DDEVICE7::SetTexture(). You group your polys by texture, if possible, as changing a texture is one of the more expensive things to do. There are some good examples here on gamedev and in the MS docs for simple texturing and rendering.

3)This is where my knowledge runs a little thin, since as of late I''ve been playing with more with d3d specific stuff. I have ideas on the subject but I imagine some of the far more skilled folk can impart greater wisdom on the subject than me so I''ll leave to them. I believe there was an earlier thread on this; you might want to check it out.

4)You can define view you want. You either set up your D3DTLVERTICES with the desired view in a similiar fasion as you did in DDraw, or if you are using untransformed stuff and playing with views transformations and what not you can set your "camera" to an angle and position that reflects the desired angle you want to person to see. It doesn''t have to be 45 degrees, it could be any view you want. Its a tad lengthy for here (and also I imagine someone can explain it better than me) but you might want to check out some of the info on basic 3d theory. They will explain the basics of cameras and views and how they reflect on what the player sees.

Personally I like using D3D. You get the advantage of hardware acceleration for one. Also you can do so many neat things so easily like rolling terrian, lighting, alpha blending, and the list goes on and on. Hope that helps,

Sieggy

This topic is closed to new replies.

Advertisement