Hello,
sorry for my english
Also, i have a problem with my spatials, spaceship, earth and asteroids are transparency ???
I have loadet and convert all the objects with MaxToJme() and load textures with ResourceLocatorTool.
In Java2-Forum one says i need to set all models to “opaque bucket”
i have done: “mySpatial.setRenderQueueMode(Renderer.QUEUE_OPAQUE);” but this nothing change.
Here youtube-video to see what i mean: Video
MyLoader:
private void load3DSModel(){
URL modelURL;
FormatConverter converter;
ByteArrayOutputStream outStream;
InputStream inputStream;
SimpleResourceLocator location;
System.out.println("Lade Model " +this.modelPath +this.modelName);
modelURL = getClass().getResource(this.modelPath +this.modelName);
converter = new MaxToJme();
outStream = new ByteArrayOutputStream();
try{
location = new SimpleResourceLocator(getClass().getResource(this.texturePath));
ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_TEXTURE, location);
inputStream = modelURL.openStream();
converter.convert(inputStream, outStream);
inputStream.close();
this.objNode = (Node)BinaryImporter.getInstance().load(new ByteArrayInputStream(outStream.toByteArray()));
System.out.println("Model " +this.modelPath +this.modelName +" erfolgreich geladen");
}catch (Exception e){
System.err.println("Exception @ load3DSModel() in MyObjects!");
System.err.println(e);
}
}
MyDefaultRenderer:
public static void setDefaultRenderer(DisplaySystem _display, Node _object, CullState.Face _face){
CullState cs = _display.getRenderer().createCullState();
cs.setEnabled(true);
cs.setCullFace(_face);
_object.setRenderState(cs);
_object.updateRenderState();
}
StarshipExtractor: // i extract all other objects at same way
this.starship = super.objNode.getChild("Starship");
super.objNode.detachChildNamed("Starship");
this.starship.setRenderQueueMode(Renderer.QUEUE_OPAQUE);
setDefaultRenderer(this.display, this.starship, CullState.Face.Front);
super.objNode.attachChild(this.starship);
MyLight:
Light light = new PointLight();
light.setDiffuse(ColorRGBA.white);
light.setAmbient(ColorRGBA.white);
light.setEnabled(true);
/** Attach the light to a lightState and the lightState to rootNode. */
LightState lightState = display.getRenderer().createLightState();
lightState.detachAll();
lightState.setEnabled(true);
lightState.attach(light);
this.rootNode.setRenderState(lightState);
Also, anyone see what make me wrong??