Hello People, again..

In the continuing saga of my attempt to learn Java3d...

I have a transform group with other TG's attached, with rotation 
interpolator behaviours, and ultimetey shape3d's at the end... (It is 
the branchgroup specified in my previous email.)

I would like to clone my whole set of objects and translate them to 
some other point in space, so I have a copy of my animated group of 
objects at a different point in space.

I have tried the following code,

{tgrotx is the root transform group of my animated group.(the first 
TG below the BG in my previous mail)
I attempt to cloneTree this transform group to a tranformgroup node 
called otherone, and then translate it to a different point in space.}

I have tried the following and a few other permutations (Using 
clonenode etc etc)

/**
                TransformGroup otherone = new TransformGroup();
                otherone = (TransformGroup)tgrotx.cloneTree(true);
                Vector3f otheronevector = new Vector3f(-1.0f,1.0f,-
5.0f);
                Transform3D otheronetransform = new Transform3D();
                otheronetransform.setTranslation(otheronevector);
                otherone.setTransform(otheronetransform);
**/
(Later, before compiling the objectbranch, I add the otherone 
Transformgroup to the root Branchgroup node - BG in the previous mail)

I use cloneTree(true) to force duplicates because without the true I 
get an array index out of bounds exception from cloneTree. To be 
honest I am not exactly sure why.

otheronevector is the translation vector for the new cloned group.

I observe the following behaviour,

when I run the code, the otherone transform group shape3d nodes seem 
to be displayed correctly for 1 frame, then they dissapear never to 
be seen again!

I thought maybe the otherone transgroup was being rotated about the 
world centre, and dissapearing because it whizzed out of view, but 
after watching the animation run for several cycles the otherone 
transgroup never re-appears, so I assume it is not being rendered for 
some reason. There are no rotation transformations above the otherone 
transgroup in the scenegraph (it is attached directly to the root 
branchgroup node, BG)

all of the bounds parameters (lights, animation scheduling bounds) 
are set to a BoundingSphere(0,0,0,1000).. It easily encompasses all 
that is happening.

My question is,

How do I clone the whole tree from a particular transformGroup down 
to a new Transform group so I can use it as a separate entity?

Also, is this the right list to be asking this kind of question? - it 
is the only place I have found so far. Are there tutorials out there 
that cover this. (I have downloaded many and not founf the answers I 
need)

Maybe my problem is that while trying to use J3D, I am also trying to 
learn Java! - I have no previous Java experience.


Thanks,

Matthew Warren.

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/

Reply via email to