Skip to main content

Multiple Transformgroups from one object

No replies
Joined: 2010-04-26


I have a problem with transformgroups.I am loading an obj file with a loader, that gives you a transformgroup.I'm loading chess figures.I only want to read the obj once from the file, for the same figures, but i didnt know how to literally clone the transformgroup, i keep getting the multiple parent exception. Here is some of my code :

public class Loader {

String fileName;

public static TransformGroup LoadModell(String filename) {

Scene s=null;
ObjectFile f = new ObjectFile ();
f.setFlags (ObjectFile.RESIZE | ObjectFile.TRIANGULATE | ObjectFile.STRIPIFY);

try {
s = f.load (filename);
} catch(IOException e ) {System.out.println("Nincs meg a f