• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 545
  • Last Modified:

How to determine Z-Order for 3D objects?

I have constructed a 3D model in Flash CS4/AS3 consisting of a space containing numerous block Display objects.  For each block, I maintain an array of Vector3D vertices.  I rotate a camera viewpoint around the constructed 3D model.

My question:  Given the current camera viewpoint, how do I determine the correct order for my block DisplayObjects?  

By calculating the average distance from the camera to a block's vertices, I can determine the correct order but only when all blocks are of the same dimensions and positions symmetrically about the space.  However, this approach is too crude for the space that I need to represent.

Thanks,

okiedev
0
okiedev
Asked:
okiedev
  • 2
2 Solutions
 
phoffricCommented:
I looked online and found these flash articles that may help:
    http://www.adobe.com/devnet/flash/articles/3d_view_controller.html
    http://www.flashmagazine.com/tutorials/detail/flash_3d_basics/
Haven't worked in flash - but I hope the info helps.

0
 
EliotBallCommented:
This might be worth a read:
http://en.wikipedia.org/wiki/Painters_algorithm

I was trying to do this some time ago, and basically you have to plump for sorting on the distance or use a 'proper' 3D engine.

Sorry! :\
0
 
EliotBallCommented:
Thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now