• Advertisement

Archived

This topic is now archived and is closed to further replies.

Creating a Tile-based engine with D3D8

This topic is 5918 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''ve got a couple of quick questions about the subject (creating a title-based engine with D3D8). First, each tile is a textured square consisting of two triangles (that parts easy). The texture actually consists of squares of tiles. Now here''s where I have a question: it would be more efficient if I could use triangle strips to define the map (each tile would only require 4 verticies instead of 6). Doing that though, each tile would share two verticies (and two texture coordinates), correct? Well, there''s a way around it, by defining each tile as a separate triangle list, but then each one would have to be rendered with a separate call to DrawPrimitive, which would be sloooooooow, correct? Second question, how exactly does non-transformed world coordinates map into texture coordinates? I of course would like each tile to fit the tile texture without having to be stretched or crammed, so if I have tile in the texture that is 32 pixels by 32 pixels, how wide (in world coordinates) would my quad need to be? Heh, does any of that make any sense? Any help is of course appreciated... ---DanMan

Share this post


Link to post
Share on other sites
Advertisement
Use indexed primitives! Indexed primitives and a triangle list. Each tile would be made up of 4 vertices and 6 indices. Or better yet, use DirectDraw...

Well anyway, as for your second question, I''m pretty sure there are many tutorials on setting up your orthographic projection such that there is a 1:1 ratio between world space and screen space.

~CGameProgrammer( );

Share this post


Link to post
Share on other sites

  • Advertisement