I am trying to make a 3D FPS in java, but I am having a hard time with the collision. I tried multiple methods but none of them worked. The code is based on ThinMatrix's 3D engine.

I want something like this:

public boolean collision(Entity e1, Entity e2) {
        if(collision) {
            return true;
        return false;

        for (Entity entity : entities) {

            if (camera.collision(camera, entity) == true) {
            System.out.println("Collision is hapening");
        renderer.render(light, camera);
  • 1
    \$\begingroup\$ As you can tell, we have lots of existing Q&A on collision-detection and collision-resolution, covering a variety of different methods appropriate to different shapes & situations. Which specific ones did you try, how did you try implementing them, and what specifically went wrong when you tried? Being specific about your issue helps us avoid re-treading the same ground, which helps you get better, more in-depth answers tailored to what you need, faster. \$\endgroup\$ – DMGregory Jan 1 at 14:05

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.