seems as it has no effect merging objects with transparency. in the final merged object all transparency has gone. is this intentional ?
i've also tried setting one of object's transparency via PolygonManager, but in that case merging objects throws a NPE. ie. following code:
Object3D one = Primitives.getBox(1, 1);
//one.setTransparency(0);
for (int p = 0; p < one.getPolygonManager().getMaxPolygonID(); p++) {
one.getPolygonManager().setVertexAlpha(p, 0, 0f);
one.getPolygonManager().setVertexAlpha(p, 1, 0f);
one.getPolygonManager().setVertexAlpha(p, 2, 0f);
}
Object3D two = Primitives.getBox(1, 1);
two.translate(0, 3f, 0);
two.translateMesh();
two.getTranslationMatrix().setIdentity();
Object3D merged = Object3D.mergeObjects(one, two);
throws:
Exception in thread "main" java.lang.NullPointerException
at com.threed.jpct.Object3D.appendToObject(Unknown Source)
at com.threed.jpct.Object3D.mergeObjects(Unknown Source)
at tmp.MergeTransparent.main(MergeTransparent.java:34)
btw, i'm a bit unclear what PolygonManager().setVertexAlpha(..) does. in my tries i saw no effect of it.
we set alpha values of vertices not the polygon. how exactly does it work ?