0

I'm currently programming a voxel engine with LWJGL and I want to optimize the fps. Can you explain me how to find out if a block is in the view of the camera? The informations I have are cubeX, cubeY, cubeZ, cameraX, cameraY, cameraZ, cameraPitch & cameraYaw.

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • You can't do frustum culling if you don't know the frustum. Camera position and orientation is far from being enough. – derhass Apr 18 '14 at 20:22
  • Ok. How can I get to know the frustum? – user2398960 Apr 18 '14 at 20:32
  • Was heißt eigentlich frustrum auf deutsch? – user2398960 Apr 18 '14 at 20:34
  • It is your code, we can't know how you set up your view frustum ("Pyramidenstumpf") – derhass Apr 18 '14 at 20:42
  • 3
    You will need to calculate the frustum, in addition to cmaera position and orientation you will also need the viewport dimensions you are rendering to and distance to near/far planes, this is an (old) but thorough tutorial: http://www.lighthouse3d.com/tutorials/view-frustum-culling/ – stridecolossus Apr 25 '14 at 15:56

0 Answers0