Skip to main content
GameDev.net gamedev.net
🔒 Locked

3D Tiles based Code setup??

Started by Soulz May 8, 2004 at 10:10 PM 2 replies 700+ views
Original Post
Soulz
Soulz
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 ...
Im a Idiot Savant without the Savant :)
Jiia
Jiia
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);
Tile++;
}
}

Hope that helps

[edited by - Jiia on May 9, 2004 3:12:23 AM]
Soulz
Soulz
**************** THE LAST POST WAS MINE ******************
LOL sry
Im a Idiot Savant without the Savant :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.