#### Archived

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.

## 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 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 CoordinatesKTile *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]

##### Share on other sites
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 on other sites
**************** THE LAST POST WAS MINE ******************
LOL sry

1. 1
2. 2
3. 3
Rutin
15
4. 4
khawk
13
5. 5
frob
12

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633663
• Total Posts
3013232
×