newbie help on ObjectContainer3D

Software: Away3D 4.x

charlito, Jr. Member
Posted: 30 March 2012 09:40 AM   Total Posts: 36

Hi

i have been studying away 3d for like 2 weeks now.. and now i kinda know my way around it..

but when i was trying some real programing . i got one problem i couldnt find any solutions..

i have some meshes that i put into a ObjectContainer3D
and then..  i nested this container into a parent container (another ObjectContainer3D)

and everythink works fine, i can move them both, rotate them.. etc…
but the problem is when i try to clean my parent container and add some other stuf..

becouse

parentcontainer.removeChild(container1);

also erase is from the view.

my cuestion is:

is there anyway to removeChilds from parent container and avoid them to remove them from scene??
cant just add them againg.. couse they were modified


do i make myself clear??


thx alot for all ur help.. or advices.. corrections

thx a lot.

   

Manuel L., Member
Posted: 30 March 2012 09:50 AM   Total Posts: 99   [ # 1 ]

hey ... when you add childs to an objectconainer3d i think they are automatically taken out of the “_view.scene-container”, thats why you have to add the objectcontainer to the scene ... so its normal that they are shown no longer, when deleting the container.

why cant you just add them again? what do you mean with “they were modified”?

just go through the objectcontainer and add all childs before deleting.

for (i:int = 0; i < container1.numChildren; i++)
{
_view.scene.addChild(container.getChildAt(i);
i—;
}

this should work, but im not sure wink

   

charlito, Jr. Member
Posted: 31 March 2012 07:13 AM   Total Posts: 36   [ # 2 ]

Hi dude..

first of all.. thx a lot for your help..  i didnt know objectcontainer3d remove elements from view..  it was helpfull but i still dont know how to solve the problem i get from remove elements from the container,
becouse i got them in the old position…

when i want to rotate 4 objects on 1 axis.. i put this 4 objects into a temporal container

rotate the container..
add the objects to the scene
remove objects from the container..
but my objects apear on the primary position..

im going crazy.. couse i have working too much on this.. i am really close.. but it seems almost impossible to make it work…

only first column on yellow faces work now..
if i erase those cubes, from the container after i rotate them.. they got render at its first position.. 

u can see really clear what i mean if u look at the running program at

//cubegame+cjb+net/

(change <+> with <.>)
(it may take a minute to load)

only works on yellow face, first yellow column and in the up and down directions..


thx alot to everyone..  i appreciate all ur advices and/or words..

i know im a bad programmer.. but im trying to improve..

thx a lot again..

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X