Jump to content
  • Advertisement


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


3D Tiles based Code setup??

This topic is 5329 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

Im looking for Info on True Full 3D Tile Based engines. I am wanting to make my oun but am still very new to Directx and as such am looking for info on different ways of seting them up. Things like Class Structure for tiles,the gird,and ways of incuding Hieght (thought Flat ground is ok i just want to be able to view the world from every where... Basicly I dont trust my ability to Make NEW classes and such so they r effective and simple and Have OOP involved. any help would be nice ...

Share this post

Link to post
Share on other sites
I just made my first 3D tile engine about 2 days ago. If you know how to do it in 2D, it's not much different.

Just translate each tile to it's grid location (x * tilesize, z * tilesize), but add it's center so 0,0 is at the top left corner. Make sure all of your tiles are the same deminsions on the x & z axes. You can also do Y rotations at 90 degree intervals with no probs. Y scaling has me confused, though, because of the way normals get messed up, so I ditched that for now. It's best to make sure your tiles can rotate on the Y axis though, or you'll find yourself creating 4 of every tile type.

My first attempted class:
struct KTile
LONG Index; // Index of which mesh to use

FLOAT YScale; // Y Scale of Tile

FLOAT YRotate;// Y Rotation of Tile

VECTOR Grid; // Grid Location


// Placing into location............

// Setup Tile Coordinates

KTile *Tile = Tiles;
for(INT z=0; z<MAPZSIZE; z++)
for(INT x=0; x<MAPXSIZE; x++)
Tile->YScale = 1.0f;
Tile->Grid.x = (x * TILEDEM) + (TILEDEM / 2);
Tile->Grid.z = (z * TILEDEM) + (TILEDEM / 2);

Hope that helps

[edited by - Jiia on May 9, 2004 3:12:23 AM]

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
Thx .... I was thinking it would be but I never trust myself so ..

The Program i want to make is one where a World is total self dependent (not a true AI but one where if i place a town or village somewhere on the map they(the NPC''s in the town) would work for food and things needed.

Mainly one where the towns or villages will Mine the mines near by and transport the materals and then grow ..

If that makes sence to you cool if not ... NP its still in a Idea stage

Share this post

Link to post
Share on other sites

  • 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!