|
|
| Voxels |
|
empty
Member #1,919
February 2002
|
I tried to make a voxelcode, to make voxelunits like the one in RedAlert 2. But somehow, i failed. Does anybody have a sourcecode i can take a look at? Or any idea how to code it. I did make pictures be placed over each other, with sprite_rotate or something, but it didnt draw right, and it didnt rotate... Just need an example for ONE 10x10x6 voxel tank. Rest can i do myself. |
|
Torbjörn Josefsson
Member #1,048
September 2000
|
I have NO idea how to do that - just want to compliment you on your ambition Was it Tiberian Sun that used voxels?.. Damn game - waited feverishly for it, bought it, threw it in the trash.. don't know what was wrong with it - it just sucked.. don't bee Too earger in copying it
-- |
|
empty
Member #1,919
February 2002
|
It is possible to make a "voxel" in PSP. Thats how i tested my theory in first place: |
|
Trezker
Member #1,739
December 2001
|
Outcast, Delta force 2, Tiberian sun. I had a voxeleditor once, I think it was made in qb. But I never got to coding anything. |
|
gnolam
Member #2,030
March 2002
|
Well, you could start by making a "voxel" heightmapper. It should give you a few ideas on how to proceed - and it's a good programming exercise, it looks good and it can easily be coded in an afternoon -- |
|
DumTiriDum
Member #2,833
October 2002
|
I haven't done voxels, but here is an idea: Each voxel is a 3d pixel, right ? therefore, the X, Y, Z coordinates of each voxel should be stored somewhere in a struct. When it is time to display the 3d model, the following transformations should be taken place: 1) transform the original coordinates to the game coordinates 2) rotate the new coordinates according to camera 3) sort the coordinates according to Z; remove invisible voxels 4) draw each voxel; a voxel should be drawn as a small cube rotated and scaled according to the object's position in the gameworld. |
|
Oscar Giner
Member #2,207
April 2002
|
4) a voxel is just a square. If you have the x and y screen coordinates and the distance from the camera, just draw a square centered in (x, y), and size inverse proportional to z. However, if you want voxels for making a 2D game, like Tiberian Sun, then all voxels have the same size, so z is only usefull for sorting. Trezker said:
Outcast, Delta force 2, Tiberian sun. What about Comanche? It was a great game. Not much time ago they released Comanche 4. |
|
Thomas Harte
Member #33
April 2000
|
But Commanche 4, and possibly 3, are not voxel heightmap based like the older ones because its a bad selection of technology for the current range of 3d accelerators. Anyway, you don't need a tutorial to figure out voxel heightmaps. They are a trivial extension of floor mappers, themselves a trivial specialisation of polygon fillers or sprite stretchers. Indeed something like a SNES would have the computing power to do voxel heightmaps if only Nintendo didn't always specialise their chips quite so much. [My site] [Tetrominoes] |
|
empty
Member #1,919
February 2002
|
I did it!!!! see what i meant with voxel units... |
|
Mike Vox
Member #2,701
September 2002
|
I tried running it but I got a black screen with some garbage graphics on the top and bottom. I'm running Windows XP. Is this the famous "black screen of death" that I hear about with earlier versions of Allegro 4? I'll try compiling if it doesn't work on my other PC. Mike_Vox |
|
Johnny13
Member #805
October 2000
|
before download any file in this forum(from newbie),read my Lesson first!:( Alg3D Praise my Games!!<code>#define SPAMMER (post>=666&&postperday>=6)</code><Mr.spellcaster>What post? <Mr.spellcaster>A useful post by me. |
|
LEDominant
Member #2,218
April 2002
|
Downloaded it. Works nicely for me on Windows XP. Strange thing is I've been using voxel map of this sort for ages and I never thought of using rotate_sprite.:-[
-------------------------------------------------------- |
|
Mike Vox
Member #2,701
September 2002
|
I tried it on my other PC that has XP also and it works fine, so I suspect it may be a problem in my setup on this one computer. Maybe I need to update the Allegro DLL I messed with the code today to see if I can get it to rotate around the x-axis, also. I was trying to figure out a way it can be rotated in any direction the same way the freeware unit editors do for Tiberium Sun. I've had some success using stretch-blit to flatten each layer as it turns around the x-axis. But that only gets you so far around the rotation. At a certain point you need to stop the flattening algorithm, and switch to another algorithm that shifts the layers in the y direction. In theory, you'd have to alternate between those two methods as it rotates around the x-axis. Mike_Vox |
|
empty
Member #1,919
February 2002
|
It should work to rotate it against or away from the screen if you shrinked the slices before placed them on screen... II ...i think... |
|
|