newbie cuestion, duplicate a primitive/container

Software: Away3D 4.x

charlito, Jr. Member
Posted: 23 March 2012 01:56 AM   Total Posts: 36

Hi everyone,

i finally were able to create a cube, with each face with a diferent color, for that, i create and position 6 diferents planes (planeGeometry)

but i need 8 cubes like this in my scene..

so.. the logical answare would be, to create 48 diferents planes…

so i was looking around and wandering if there is a way i can just duplicate an existing geometry..
all my 6 planes are in a 3d container..

so.. is there a way to improve this code and dont declare and position 48planes 1 after 1 after another after another???


any ideas or advices or links to related information is greatly appreciated.


thx a lot.  smile

   

Avatar
Matse, Sr. Member
Posted: 23 March 2012 09:18 AM   Total Posts: 149   [ # 1 ]

Yup, sounds like what you need is the clone() function :

var newCube:ObjectContainer3D cubeContainer.clone() as ObjectContainer3D 

it will duplicate the container and all its children (your 6 planes)

   

charlito, Jr. Member
Posted: 23 March 2012 07:39 PM   Total Posts: 36   [ # 2 ]

dude!!!!
that is awesome!!!!

it is exactly what i need it…

thx.. 

smile

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X