Sorry for the bad explanantion,
the problem is that i´m trying to get the shape of the door using the getNodeNamed() of ase loader, and i it doesen´t return the model in the scene.
The code to load the scene is this:
public class Armario_Porta {
private BranchGroup armario; // the closet
private BranchGroup porta_direita; // the right door
private BranchGroup porta_esquerda; // the left door
public Armario_Porta () {
loadGeom();
}
private void loadGeom() {
try {
/*
* Loads the ASE file
*/
AseFile af = new AseFile();
BufferedReader br = null;
try {
// Attempts to read the file normally
br = new BufferedReader(new FileReader("FindTheElements/Models/Armario_Porta.ASE"));
} catch (IOException e) {
// Attemts to read file from JAR
URL url = this.getClass().getClassLoader().getResource("FindTheElements/Models/Armario_Porta.ASE");
br = new BufferedReader(new InputStreamReader(url.openStream()));
}
AseReader r = new AseReader(br);
af.parse(r);
armario = new BranchGroup ();
porta_direita = new BranchGroup ();
porta_esquerda = new BranchGroup ();
// Extracts list of named nodes
Map nodes = af.getNamedNodesMap();
armario.addChild((Node) nodes.get("Armario"));
porta_direita.addChild((Node) nodes.get("Porta_Dir01"));
porta_esquerda.addChild((Node) nodes.get("Porta_Esq01"));
} catch (Exception e) {
e.printStackTrace();
}
}
public BranchGroup getArmario() {
return armario;
}
public BranchGroup getPortaDireita() {
return porta_direita;
}
public BranchGroup getPortaEsquerda() {
return porta_esquerda;
}
}
and the code to create the transform so i can translate the door when picked is this:
public void loadScene() throws IOException{
AseFile sala = new AseFile();
BufferedReader br_sala = null;
try {
// Attempts to read the file normally
br_sala = new BufferedReader(new FileReader("FindTheElements/Models/Sala.ASE"));
} catch (IOException e) {
// Attemts to read file from JAR
URL url = this.getClass().getClassLoader().getResource("FindTheElements/Models/Sala.ASE");
br_sala = new BufferedReader(new InputStreamReader(url.openStream()));
}
AseReader r_sala = new AseReader(br_sala, sala);
sala.parse(r_sala);
java.util.HashMap namedNodes = new java.util.HashMap();
TransformGroup raiz_TG = sala.getTransformGroupTree(namedNodes);
Armario_Porta armario01 = new Armario_Porta();
TransformGroup porta_esq01 = new TransformGroup ();
porta_esq01.addChild(armario01.getPortaEsquerda());
TransformGroup porta_dir01 = new TransformGroup ();
porta_dir01.addChild(armario01.getPortaDireita());
TransformGroup tg_armario_porta01 = new TransformGroup ();
tg_armario_porta01.addChild(armario01.getArmario());
tg_armario_porta01.addChild(porta_esq01);
tg_armario_porta01.addChild(porta_dir01);
sceneGroup.addChild(raiz_TG);
sceneGroup.addChild(tg_armario_porta01);
Vector3f pos = new Vector3f(-34.078f,-15.722f, -91);
Transform3D tr = new Transform3D();
tg_armario_porta01.getTransform(tr);
tr.rotY(-3.0f);
tr.setTranslation(pos);
tg_armario_porta01.setTransform(tr);
}
but in the scene it shows the shape of the closet but none of doors