Link to home
Start Free TrialLog in
Avatar of okiedev
okiedev

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of phoffric
phoffric

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of EliotBall
EliotBall

Thanks