AreaClodMesh doesn't seem to collapse

Hi



I want to increase performance by using AreaClodMesh for my models. My code to

doing this is inspired form the HelloLOD-testclass. But if I let the game display

renderer.getStatistics(), nothing seems to happen when I move (very far) away

from the cloded model. Here is my code I am using for creating the AreaClodMesh:



   private static Node getClodNode(Node parentNode, String modelPath) {
      Node clodNode = new Node("Clod-Node");
      for(Spatial child : parentNode.getChildren()) {
         if(child instanceof Node) {
            clodNode.attachChild(getClodNode((Node)child, modelPath));
         } else if(child instanceof TriMesh) {
            AreaClodMesh clodMesh = new AreaClodMesh(child.getName(), (TriMesh)child, null);
            clodMesh.setTrisPerPixel(.5f);
            clodMesh.setDistanceTolerance(0f);
            clodMesh.setCullMode(SceneElement.CULL_DYNAMIC);
            
            clodMesh.setModelBound(new BoundingSphere());
            clodMesh.updateModelBound();
            
            TextureLoader.updateTextureQuality(modelPath, clodMesh, child.getName());
            clodMesh.setRenderState(child.getRenderState(RenderState.RS_MATERIAL));
            clodMesh.updateRenderState();
            
            clodNode.attachChild(clodMesh);
         }
      }
      clodNode.setLocalScale(0.08f);
      return clodNode;
   }



In TextureLoader.updateTextureQuality() the texture is just applied, I don't think that this code
is relevant. Hope you can help me with this :)

Nobody using AreaClodMesh? Or is there another possibility to reduce the geometry when

a model is far away from the camera? Loading another model with fewer polygons seems

to be not the answer to me…

I'm facing the same problem too…

did you solve?

works fine for me…

try making a ClodMesh out of your model and then setting the target record to getRecordQuantity()…

you should see a vastly reduced mesh…if it works it will show if the clod is being generated correctly…

otherwise i don't know…