Karl:
I have never used clone. But I did use the SharedGroup. Here is how I used
them:
I first created a class extends SharedGroup where I have the geometry,
appearance, etc defined. Aware of that this is just a type of Group.
Then in the class that I need to plant the object of the SharedGroup, I
used the following code:
Vector3f treeTranslate = new Vector3f();
treeTranslate.set( x,
getElevationGrid().getRelativeElevation( x, z ), z );
Transform3D treeT3d = new Transform3D();
treeT3d.setTranslation( treeTranslate );
// treeTGT plant the object where you want it to be
TransformGroup treeTGT = new TransformGroup();
treeTGT.setTransform( treeT3d );
Link link = new Link();
link.setCapability(Link.ALLOW_SHARED_GROUP_READ);
... ... // set capability
link.setSharedGroup(shGroupObject);
// shGroupObject is the instance of the SharedGroup
At 03:46 PM 7/9/2002 +0100, you wrote:
>Hi,
> I have created objects using shared groups and I
>want to make shared groups of these groups. But I am
>coming unstuck.
>
>Currently I have a grid of objects, and I want to
>create a new instance of the grid, but translated over
>to the left or right. Then I want to be able to
>specify how many new instances to create.
>
>Is there a way to use nodeClone() or something? Or can
>I create a sharedGroup of the grid, and place the new
>instances where ever I like in the scene?
>
>Has anyone got any example code of cloning in action
>or sharedGroups that might answer some of my
>questions?
>
>Sorry for bugging you clever people!
>
>Cheers
>KP
>
>__________________________________________________
>Do You Yahoo!?
>Everything you'll ever need on one web page
>from News and Sport to Email and Music Charts
>http://uk.my.yahoo.com
>
>===========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff JAVA3D-INTEREST". For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".
Lan Wu-Cavener
Dept. of Landscape Architecture
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".