Hi All,
I am new 3D programming, so bear with me here.
I have installed Xith3D and all relating libraries and I can run the demo’s fine. However, I am having problems with “picking” on models that are loaded eitheir with TDSLoader or the ASE loader.
I thought it may have been my code so went back and “moded” the example for picking (http://www.xith.org/tutes/GettingStarted/html/picking.html).
Specifically I took out left, middle and right plane shapes, and loaded an ase model, which displays fine, but I cant pick it!
This is the code I have used to get the model out, the rest of the code is the same as the picking example:
AseFile af = new AseFile();
try
{
AseReader r = new AseReader(new BufferedReader(new FileReader("model/cube.ase")), af);
af.parse(r);
}
catch (IOException e)
{
System.out.println("Error reading ase file");
}
// Extracts list of named nodes
java.util.Hashtable views = af.getNamedNodes();
for (Enumeration e = views.keys(); e.hasMoreElements();)
{
String current = (String)e.nextElement();
BranchGroup group = (BranchGroup)views.get((Object)current);
group.setPickable(true);
sw.addChild(group);
}
Or something along those lines, basically from the tank example.
I have gone through and recursively got the parents to make sure that they are all set to pickable, and tried numerous other things but it just wont work!
Please help, what am I missing here?
Cheers,
Pinkman!
