How to add 3d collisions to Glut game

by TRGamer TR   Last Updated September 11, 2019 23:13 PM

Hi guys i want add 3d collisions in to my game. But i dont want use physics library they are so complex. I tried write like this thing but not work as expected:

void collidek(int x,int y,int z, bool scfw = 1) {

    if (x > 3) {
        scfw = 0;

    if(x < 3) {

        scfw = 1;
        if (scfw = true){
            x-= 5.0f;

    if (z > 3) {
        scfw = 0;



So i dont know alegebra my alegebra is really low.

I want ultra basic collision detection can be buggy not matters only i want working collision detection.

Also please dont say not useful comment for example go learn some alegebra like this things.

Only give the code please. I needed very very basic collision detection i wonder is a AABB collision system that uses maximium 20 lines of code and readable.


Tags : c++ glut

Related Questions

Can a computer game be done without collision?

Updated September 18, 2019 16:13 PM

I want ULTRA BASIC AABB Collision

Updated September 12, 2019 20:13 PM

C++ FreeGlut Really Basic Collisions

Updated September 13, 2019 17:13 PM

Invalid coordinates returned by glutMouseFunc()

Updated May 01, 2015 21:05 PM

Editing the pixels of a rendered image

Updated May 05, 2015 21:05 PM