PDA

Click to See Complete Forum and Search --> : 3D Z-Buffering ?



CharlesFK
03-21-2002, 11:59 AM
I'm building a small animation with 3 object (FPoint, FSurface & FPrism) that I use to simulate 3D Object. Once I calculate the depth and the rotation the 3D point, it's quite easy to draw the figure in MX.

I found a bunch of site to help me with the 3D rotation, but I didn't found one to help me calculate which surface is farthest from the viewew eye, so I can draw it first.

The model I build works fine on the X rotation.

http://www.geocities.com/charlesfk/xRot.html

but of course, it's not working with free X & Y rotation

http://www.geocities.com/charlesfk/free.html

Anyone know of a web site where I can get info to calculate the Z-Buffer ?

[Edited by CharlesFK on 03-21-2002 at 11:05 AM]

Ed Mack
03-22-2002, 07:46 AM
Can't you just use the objects z coord?

CharlesFK
03-23-2002, 04:22 PM
I manage to fix the problem by averaging the Z coordinate of each surface after it's been draw then I swapDepths the surface. It's quite complex since it been executed on each frame for all surface. There must be a easier way.


Here's a new sample. On this one, the free rotation works just fine. But it's slow, when there a lot of surface to draw. On this example there's only 4 surface, so it's ok.

http://www.geocities.com/charlesfk/3dEngine_pyramide.html

If anyone interested in the code, just message me.

Ed Mack
03-23-2002, 04:39 PM
Oh, sorry, I didn't realize you meant faces. Averages is what I use too