Hi all!
I`am bulding a virtual city demo. I have a number of building models (from google scketchup, he-he) in collada format.
I would like to show all of them using CLOD feature. So, I’am loading a model (for example this one), making a ClodAreaMesh for each Trimesh in the model with:
private Node getClodNodeFromParent(Node meshParent) {
Node clodNode = new Node("New clod node");
for (int i = 0; i < meshParent.getQuantity(); i++) {
final Spatial child = meshParent.getChild(i);
if (child instanceof Node) {
clodNode.attachChild(getClodNodeFromParent((Node) child));
} else if (child instanceof TriMesh) {
AreaClodMesh acm = new AreaClodMesh("part" + i, (TriMesh) child, null);
acm.setModelBound(new BoundingSphere());
acm.updateModelBound();
acm.setTrisPerPixel(0.1f);
acm.setDistanceTolerance(5);
acm.setCullHint(Spatial.CullHint.Dynamic);
acm.setTextureCombineMode(child.getTextureCombineMode());
acm.setRenderState(child.getRenderState(StateType.Texture));
acm.setRenderState(child.getRenderState(StateType.Light));
acm.setRenderState(child.getRenderState(StateType.Material));
acm.setTargetRecord(1);
clodNode.attachChild(acm);
} else {
}
}
clodNode.setModelBound(new BoundingBox());
clodNode.updateModelBound();
clodNode.setNormalsMode(meshParent.getNormalsMode());
clodNode.setLocalTranslation(meshParent.getLocalTranslation());
clodNode.setLocalRotation(meshParent.getLocalRotation());
clodNode.setLocalScale(meshParent.getLocalScale());
return clodNode;
}
(the code has been found on this forum and modified to save scales, rotations/transformations and textures)
After all of this I can't see any difference in model while zooming/unzooming. I believe the detalization of this model should significantly fall down while unzooming, but it isn't so. Why?
Should the model be somehow prepared or something?
I've tried the model from the tests - statue.ace and it works exactly as I expect. What is the difference between them?
Thanks!