Advertisement

How do you deal best with angles and circular areas in collision detection ?

Started by January 15, 2003 12:15 PM
-1 comments, last by LostBoy 21 years, 10 months ago
I am having some trouble with this. I am thinking that pixel color detection and a bounding area may be the way to do it. However, I'm having problems geting glReadPixels to work with my floating point values for X and Y coordinates. It is definitely something that I am doing wrong with the syntax as I am new to opengl. Could somone show me how to properly write this statement, but have it use floating point numbers instead of integers ? glReadPixels((int)ballX,((int)ballY),1,1,GL_RGB, GL_UNSIGNED_BYTE, (void *)pixels); Then, how do I use the value it returns? IE - what statement is used to use this return value? I don't need the whole idea explained, I'm just trying to find the syntax for the statements, and I can figure out what to actually do after a contact between the ball and the edge of the course (it's a golf game)has occured. If anyone knows a simpler approach, by all means tell me about it. The part that is giving me the most trouble is dealing with the angled parts of the course. BTW, I'm only dealing with 2D right now. Trying to keep it simple. And I'm using openGl and MSVC++ on Windows 98. [edited by - LostBoy on January 15, 2003 2:03:48 PM]

This topic is closed to new replies.

Advertisement