![]() |
|
This thread is locked; no one can reply to it.
![]() ![]() |
1
2
|
3d matrix |
vixinu
Member #7,343
June 2006
![]() |
Just out of curiosity, I'm not working on anyrhin 3d, how would you do a 3d tilemap matrix, ex. a 3 x 3 x 3 ? |
Andrei Ellman
Member #3,434
April 2003
|
I'd use a 3 dimensional array. AE. -- |
vixinu
Member #7,343
June 2006
![]() |
Oops, I worded that wrong. I kinda meant how you programmed a 3d array. By the way, where did you get that animation? |
LennyLen
Member #5,313
December 2004
![]() |
Quote: I kinda meant how you programmed a 3d array. Here's an example:
|
Avenger
Member #4,550
April 2004
|
Quote: int map[WIDTH][HEIGHT][DEPTH];
I believe this is more accurate: With arrays you have to use inverse of what you want (for optimal memory access that is).
|
vixinu
Member #7,343
June 2006
![]() |
So how do you do a tilemap w/ a 3d array? |
gnolam
Member #2,030
March 2002
![]() |
By letting the array elements denote tiles. -- |
vixinu
Member #7,343
June 2006
![]() |
But with the numbers denoting tiles. |
gnolam
Member #2,030
March 2002
![]() |
IHBT, IHL, HAND? -- |
vixinu
Member #7,343
June 2006
![]() |
which are?.?.? |
LennyLen
Member #5,313
December 2004
![]() |
I think gnolam is wondering if you have the faintest idea of what you are talking about.
|
vixinu
Member #7,343
June 2006
![]() |
I haven't done anything 3D before. Besides, you're not gnolam. Gnolam can speak for himself. |
gnolam
Member #2,030
March 2002
![]() |
I'm simply wondering if you're trolling or if you really are as thick as you appear to be... -- |
LennyLen
Member #5,313
December 2004
![]() |
Quote: Gnolam can speak for himself Yes, but I get the feeling that it would have to be censored. Quote: I haven't done anything 3D before. Well for starters, you don't use tilemaps in 3D graphics. A 3d tilemap array is something different. It allows you to add layers to 2d tilemaps so that you can do things like 'fake 3d' games, and animated tiles.
|
vixinu
Member #7,343
June 2006
![]() |
O |
Jonny Cook
Member #4,055
November 2003
|
So you have a 3D array, right? It can be an array of ints. You loop through it, just as described by LennyLen. Each int can hold say, 1 or 0. 1 is for a tile, 0 is for no tile. Assuming you have a bitmap/model representation for the tile, you could do something like this. for( z = 0; z < DEPTH; z++ ) { for( y = 0; y < HEIGHT; y++ ) { for( x = 0; x < WIDTH; x++ ) { if (map[x][y][z]) { DrawTile(x, y, z); } } } } That's a very simple tile map. I'll leave it up to you to decide how DrawTile is implemented. [edit] The face of a child can say it all, especially the mouth part of the face. |
Andrei Ellman
Member #3,434
April 2003
|
LennyLen said: Well for starters, you don't use tilemaps in 3D graphics. A 3d tilemap array is something different. It allows you to add layers to 2d tilemaps so that you can do things like 'fake 3d' games, and animated tiles. You could still design a 3D level by using a 3D array to represent which blocks appear at certain discrete locations in 3D space (gap, brick wall, metal wall, etc.). You'd be using blocks instead of tiles, but you'd be using a 3D array like you would do for a 3D tilemap. 3D tilemaps are probably best sed for 2D games where the tiles consist of several layers (eg. what lies under the floor, the floor, the walls, and a transparent ceiling). vixinu said: By the way, where did you get that animation? See this thread AE. -- |
vixinu
Member #7,343
June 2006
![]() |
This has nothing to do with anything in the topic thus far, but I get this error message when I run my code in g++: error message: maptest.cpp: In function 'int _mangled_main(int, char**)': code:
|
gnolam
Member #2,030
March 2002
![]() |
I stand by my previous comment(s). -- |
vixinu
Member #7,343
June 2006
![]() |
Which ones? |
Neil Walker
Member #210
April 2000
![]() |
He's wondering if you're trolling. Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
vixinu
Member #7,343
June 2006
![]() |
No. [edit]I found a few reasons for a few of the bugs, and cut it down to specific code. Now the error is: maptest.cpp:26: error: at this point in file the code is: (starting line 10)
|
LennyLen
Member #5,313
December 2004
![]() |
Try using load_bitmap() correctly.
|
deps
Member #3,858
September 2003
![]() |
vixinu
Member #7,343
June 2006
![]() |
I've read the manual, here is my new error and code: maptest.cpp:36: error: expected primary-expression before 'palette'
|
|
1
2
|