Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Voxel sprites, and HTF you do them.
#1
How the heck do you display voxel sprites? I'm sure making an editor to make the voxel information is quite easy, but how the heck are they done?

I have very basic SIN COS and TAN knowledge. (thank goodness I have ANY)...
Reply
#2
voxels are just dots in 3d space. consider them as vertices. standard matrix rotation, scaling and translating can be applied to voxels. check out CosmoX's demo proggies.
the major problem in freeform voxel objects is the hidden surface removal.
you can try to sort them by Z values or code Z-buffering algorithm.
I think it's better to use polygons instead of voxels to describe objects.
ll formed pragma
Reply
#3
Quote:the major problem in freeform voxel objects is the hidden surface removal.

THERE, is the problem for me. How the heck do I tell the program which pixels to draw over / not draw at all at different angles? I have no idea how to determine whether or not an object is behind something.
Reply
#4
Well, for each frame, you have to take all your voxels and order them according to the distance to the camera. Once you've ordered your voxels you begin drawing from the furthest to the nearest.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#5
or try z-buffering stuff.

make two layers. the draw layer and Z-buffer. both'll take 64kb.
then round the z-values of voxels in the way they can have values from 1-255. 0 is empty.
- put a pixel to z buffer. the color is the rounded Z-value
when you draw a new voxel, check with CSPoint (or similar) the previous Z-value of the pixel.
if it's zero or greater than the z-value of the voxel which currently about to be drawn, CSPset (or similar) the pixel to the actual draw-layer, and update the z-buffer (with pset) with the new rounded z-value.
this is very efficent (it'll always draw the object in the right way) but it has an overdraw problem. you can for instance use object-based sorting and then use the z-buffer when you draw a single object.
ll formed pragma
Reply
#6
Quote:or try z-buffering stuff.

make two layers. the draw layer and Z-buffer. both'll take 64kb.
then round the z-values of voxels in the way they can have values from 1-255. 0 is empty.
- put a pixel to z buffer. the color is the rounded Z-value
when you draw a new voxel, check with CSPoint (or similar) the previous Z-value of the pixel.
if it's zero or greater than the z-value of the voxel which currently about to be drawn, CSPset (or similar) the pixel to the actual draw-layer, and update the z-buffer (with pset) with the new rounded z-value.
this is very efficent (it'll always draw the object in the right way) but it has an overdraw problem. you can for instance use object-based sorting and then use the z-buffer when you draw a single object.

...I will never do voxels.

Ever.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)