Newbie question: How to turn on z-sorting, layering, depthing (or whatever) you would call it.

Software: Away3D 4.x

tsymons, Newbie
Posted: 10 October 2012 03:20 PM   Total Posts: 3

Heelo all!

Started using the Away3D code and it is pretty easy to build stuff. I just have a small issue that I am sure is a newbie mistake.

I created 27 cubes and grouped them into a ObjectContainer3D container. I then added in a HoverController to use my mouse to control the panAngle and tiltAngle (got this from the Lee Brimelow video).

The issue is when I rotate the container, the cubes in the back do not come forward, they stay at their current layering position. Make for a neat effect but was not what I was expecting.

You can see the sample here: http://demos.websterlabs.com/away3d/

I searched the forum but, honestly, I may have searched for the wrong words.

Any help or point to a forum post that would help would be greatly appreciated.

Thanks!
Tim

   

tsymons, Newbie
Posted: 10 October 2012 05:12 PM   Total Posts: 3   [ # 1 ]

I think that part of my problem is that I have applied my material as a SkyBoxMaterial. When I use a simple ColorMaterial, the boxes appear to render correctly when I pan and title the carmera.

Can anyone help me with createing a cube? All of the demos I have found only use a Cube class which does not seem to be a part of Away3D anymore.

Thanks.
Tim

   

Avatar
80prozent, Sr. Member
Posted: 10 October 2012 05:42 PM   Total Posts: 430   [ # 2 ]

hi tim

jes using the skybox material on any object other than a skybox is a bad idea.

the usage of primitives have changed recently.

now you create a CubeGeometry
than you create a mesh using this Geometry

in one line this looks like this:

var mesh:Mesh=new Mesh(new CubeGeometry252525 )); 

check the examples on github.
the example Intermediate_MouseInteraction.as uses cubes.

hope that helps

 

 Signature 

sorry…i hope my actionscript is better than my english…

   

tsymons, Newbie
Posted: 10 October 2012 05:47 PM   Total Posts: 3   [ # 3 ]

80prozent,

Yes, that helps quite a bit, thanks! I was just looking at those examples and saw how they built cubes. Applying that code to my code fixed my issue.

Thanks again!
Tim

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X