A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: 3D Z-Buffering ?

  1. #1
    Senior Front End Developper
    Join Date
    Dec 2000
    Location
    Montréal
    Posts
    568
    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]

  2. #2
    Gross Pecululatarian Ed Mack's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    2,954
    Can't you just use the objects z coord?

  3. #3
    Senior Front End Developper
    Join Date
    Dec 2000
    Location
    Montréal
    Posts
    568
    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/3..._pyramide.html

    If anyone interested in the code, just message me.

  4. #4
    Gross Pecululatarian Ed Mack's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    2,954
    Oh, sorry, I didn't realize you meant faces. Averages is what I use too

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center