Track Position in OpenGL ES

Started by
1 comment, last by DiscGolfer17 11 years, 3 months ago

I have some models moving around a sphere using glRotate() and glTranslate() which all works how I want. Now I need to add collision detection. Each model has a bounding box and bounding sphere associated with it. How do I keep track of each models' position and apply that to the bounding box and bounding sphere so that I can test for collisions? I am using Java on Android, with the libGDX framework on OpenGL ES 1.1.

Advertisement
I have some models moving around a sphere using glRotate() and glTranslate() which all works how I want. Now I need to add collision detection. Each model has a bounding box and bounding sphere associated with it. How do I keep track of each models' position and apply that to the bounding box and bounding sphere so that I can test for collisions? I am using Java on Android, with the libGDX framework on OpenGL ES 1.1.

There is another thread about this topic here

http://www.gamedev.net/topic/300428-sphere-box-collision/

I hope it's useful.

Thanks, that will definitely help when I get to the actual testing of collision detection. My problem right now is keeping track of the x, y, and z coordinates of the model after calls to glRotate() and glTranslate() which in turn need to transform the corresponding bounding box/sphere for that model. Right now, the drawing is working how I expect but I need a way to keep track of the position in the world.

This topic is closed to new replies.

Advertisement