Teaching Open gl Logic...

"You can't walk through walls...THERE SOLID"

Page 1 of 1

4 Replies - 1024 Views - Last Post: 05 January 2009 - 01:50 PM Rate Topic: -----

#1 UG Cyber  Icon User is offline

  • D.I.C Addict

Reputation: 32
  • View blog
  • Posts: 546
  • Joined: 24-July 08

Teaching Open gl Logic...

Post icon  Posted 04 January 2009 - 07:59 AM

As you can guess....im pretty new to openGL but i'm learning quick. I learned how to make simple shapes and got the camera going, but what i want to know is a couple pointers on how to teach openGL that it can't walk through walls.
Is This A Good Question/Topic? 0
  • +

Replies To: Teaching Open gl Logic...

#2 Tom9729  Icon User is offline

  • Segmentation fault
  • member icon

Reputation: 180
  • View blog
  • Posts: 2,641
  • Joined: 30-December 07

Re: Teaching Open gl Logic...

Posted 04 January 2009 - 12:27 PM

Are you asking about collision detection?
Was This Post Helpful? 0
  • +
  • -

#3 bobjob  Icon User is offline

  • D.I.C Head

Reputation: 23
  • View blog
  • Posts: 163
  • Joined: 29-March 08

Re: Teaching Open gl Logic...

Posted 04 January 2009 - 01:54 PM

stuff like wall collision, is done seperate from openGL, openGL is only really used to draw the scene
Was This Post Helpful? 0
  • +
  • -

#4 UG Cyber  Icon User is offline

  • D.I.C Addict

Reputation: 32
  • View blog
  • Posts: 546
  • Joined: 24-July 08

Re: Teaching Open gl Logic...

Posted 05 January 2009 - 12:43 PM

View Postbobjob, on 4 Jan, 2009 - 12:54 PM, said:

stuff like wall collision, is done seperate from openGL, openGL is only really used to draw the scene


well i have one way so far. but it is a little jumpy.
void CheckEvent()
{
        if(xpos >= -3.0 && xpos <= 4.5)
        {
                if (zpos >= 0.0 && zpos <= 2.6)
                {
                        xpos = xprev;
                        zpos = zprev;
                }
        }
        else
        {
                zprev = zpos;
                xprev = xpos;
        }
        glDraw();
}



That maps the area of the object and doesnt let me pass. but it reverts too far back. it doesnt just stop...
Was This Post Helpful? 0
  • +
  • -

#5 Tom9729  Icon User is offline

  • Segmentation fault
  • member icon

Reputation: 180
  • View blog
  • Posts: 2,641
  • Joined: 30-December 07

Re: Teaching Open gl Logic...

Posted 05 January 2009 - 01:50 PM

Edit: Nevermind.

This post has been edited by Tom9729: 05 January 2009 - 01:50 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1