简体   繁体   中英

How do I detect collision with C++, OpenGL, and freeglut?

I am making a maze game, and I know how to do everything except make it so that you can't just cheat your way through the walls. I am using freeglut with OpenGL in C++ and I would like to know the most effective way of using collision detection ( hopefully without needing to use anything other than freeglut).

OpenGL is just for drawing; it makes things appear onscreen at the coordinates you specify, but it doesn't play a role in deciding what the coordinates of your objects should be. For motion and collision, you may want to use a physics library, such as ODE or Bullet . (There are also bigger, more commercially-oriented physics systems like Havok and PhysX , but those are probably overkill for a simple project.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM