0

This image mainly explains my problem:

Problem

The frustum.boundsInFrustum method detects the floor as inside of it, however neither the box nor the other one that has the bricky texture gets detected, and the frustum 3d representation does not touch nor contains any of them. I've tried other locations and objects inside my map and large models behind the frustum far plane often interfere and trigger this problem.

The FrustumCulling test works fine, even if I replace the method sphereInFrustum with boundsInFrustum and if I shorten the frustum lenght (in order to get some objects behind the frustum far plane) inside the test. I will try replicating the issue in there too by modifying the object's size. (Tried it already, test works flawlessly, something in my code then...)

NOTE: FrustumCullingTest uses bullet by default to test if an object is inside another, so it is not applicable to this case.

EDIT: boundsInFrustum in the image's scenario told me that there are at least one corner of the floor that are indeed in the inside face of any of the frustum's plane, so the method always returns true. I think what's happening here is that if the frustum is smaller than the object and if it's pointing at the middle of it, every plane has a point in its inside face.

LosTChG
  • 77
  • 2
  • 7
  • Without seeing your code it's almost impossible to help with your specific problem. However, the FrustumCullingTest in the bullet tests package of libgdx is not useful in most scenario's, don't base your code on that. Instead this might help: http://blog.xoppa.com/3d-frustum-culling-with-libgdx/ – Xoppa Mar 10 '14 at 12:22
  • My use of a Frustum (which is not for culling) needs a more precise approach than using sphereInBounds (I can't use a sphere to represent an object that is large and flat). Anyway, thanks for all your great tutorials! :D. I think I will use Bullet this time – LosTChG Mar 11 '14 at 13:56

0 Answers0