Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-07-2012, 05:23 PM   #1
Senior Member
Join Date: Jan 2011
Posts: 135
Default Building cube and layering

I've started to build a cube by adding six planes (sprites) to a small sprite at the cubes center.
I then rotated the cube by rotating the center sprite.
The problem is that each side (a different color) is added to the display in the same order so some sides appear in front when they should be behind.
Is there a simple solution to this problem?
PATurmel is offline   Reply With Quote
Old 06-07-2012, 06:12 PM   #2
Senior Member
Join Date: Jan 2012
Posts: 608

If you're using the flash 10 2.5d proprties (.z, .rotationX, .rotationY, etc), then there's no simple built-in solution. Flash's 2.5d engine does not have z-depth sorting; you have to implement it yourself. Other people have already done this though, here's one implementation I found that might work for you:

ZBuffer Class For Sorting Depths
dmb85 is offline   Reply With Quote
Old 06-10-2012, 08:12 PM   #3
Senior Member
Join Date: Jan 2011
Posts: 135

Yeah the answer was simple,

1. remove all six sides
2. sort with respect to Z values (desending)
3. add all six sides back
PATurmel is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 04:42 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.