How do I make bounds more accurate?

I have a rendered terrain page, and if I get the camera close, it starts sometimes culling right infront of me. It applied a sphere bound to it. And I dont know how to make the bounds more accurate :frowning:

Are you sure it's getting (frustum) culled? That would mean an entire block section dissappears at once. If you're just seeing part of the terrain slowly dissappearing, likely you are dealing with drawing distance. For changing that look at the Camera class.

I believe Llama's right, it sounds like the terrain is passing the near plane of the camera, so set that to a smaller value (smaller distance). Be careful setting it to small otherwise you'll start getting rendering artifacts as the depth buffer only has so many bits to work with.


If I move a little into the blue area ( Background is blue, that part of terrain is culled)
it disappears, but if I move back a little it appears. I dont know what to look for in the camera class also ><





That doesn't seem to be a camera issue. Rather, a problem with the bounding you applied. Did you call updateModelBound() ? Also, a box might be better for terrain than a sphere.

Yes, I updated model bound(of the terrain). I tried a bounding box. Now, the blue areas are bigger, and last longer :frowning:

Could you show the code you use to make the terrain page?

also: a shot with boundings truned on and your camera creation code would be useful.  Often culling issues from users have been in their camera construction code.



Camera is normal construction in the base game.


   
        h2 = NewTerrain.getFaultFractalBlock(display, 5, 5);
        BoundingSphere terrain = new BoundingSphere();
        h2.setModelBound(terrain);
        cam.setLocation(j.getLocalTranslation().add(x,y,z));
   cam.lookAt(j.getLocalTranslation());
   cam.update();
   h2.updateModelBound();







are you using cvs jME or something older?

jME .9

Ah, that would explain it.  The lookAt function in .9 and earlier does not update the camera frame, it simply overrides the camera look in GL.  If you can upgrade to cvs jME and use the lookAt(Vector3f, Vector3f) function, you hsould find it works better.

I <3 renanse, llama, and mojomonkey. THANK YOU :slight_smile:

Thanks…  I think.    :stuck_out_tongue: