   Problems with line-circle collision detection (final part)
  ****I am so sorry that I'm having to chunk this into 4 separate posts and that they aren't contained in source tags.  Any time I tried to use source tags around my code, the entire forum would lock up on me for some reason : o \  ****and is visually represented inMy display function------------------------------------------void display(UGWindow uwin){glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);glLoadIdentity();GLfloatxtrans = -xpos;GLfloatztrans = -zpos;GLfloatytrans = -walkbias - 0.25f;GLfloatsceneroty = 360.0f - yrot;int numtriangles;glRotatef(sceneroty, 0, 1.0f, 0);glTranslatef(xtrans, ytrans, ztrans);glEnable(GL_TEXTURE_2D);glDisableClientState(GL_COLOR_ARRAY);//shouldn't be enabled anyway, but I need it to be offglBindTexture(GL_TEXTURE_2D, textures[texIdx - 1]);numtriangles = sector1.numTriangles;ugluLookAtf(0.0f, 0.25f, 0.0f,0.0f, 0.25f, 7.0f, //y=1.5f0.0f, 1.0f, 0.0f);//Process Each Triangleif(glIsEnabled(GL_CULL_FACE)){glDisable(GL_CULL_FACE);}for(int m_loop = 0; m_loop < numtriangles; m_loop++){GLfloat triangle[9];//maintains shape in 3D space; x, y, and z coords for 3 pts = 9GLfloatroomTexCoords[6];//texCoordsroomTexCoords[0] = sector1.triangle[m_loop].vertex[0].u;roomTexCoords[1] = sector1.triangle[m_loop].vertex[0].v;roomTexCoords[2] = sector1.triangle[m_loop].vertex[1].u;roomTexCoords[3] = sector1.triangle[m_loop].vertex[1].v;roomTexCoords[4] = sector1.triangle[m_loop].vertex[2].u;roomTexCoords[5] = sector1.triangle[m_loop].vertex[2].v;glEnableClientState(GL_TEXTURE_COORD_ARRAY);glTexCoordPointer(2, GL_FLOAT, 0, roomTexCoords);//pt1triangle[0] = sector1.triangle[m_loop].vertex[0].x;triangle[1] = sector1.triangle[m_loop].vertex[0].y;triangle[2] = sector1.triangle[m_loop].vertex[0].z;//pt2triangle[3] = sector1.triangle[m_loop].vertex[1].x;triangle[4] = sector1.triangle[m_loop].vertex[1].y;triangle[5] = sector1.triangle[m_loop].vertex[1].z;//pt3triangle[6] = sector1.triangle[m_loop].vertex[2].x;triangle[7] = sector1.triangle[m_loop].vertex[2].y;triangle[8] = sector1.triangle[m_loop].vertex[2].z;//Triangle is loaded from sector1.  DRAW TRIANGLEglVertexPointer(3, GL_FLOAT, 0, triangle);glDrawArrays(GL_TRIANGLES, 0, 3);//glDrawArrays(mode, <start>, #ofverts)}//for(m_loop)drawSky();glPushMatrix();{glScalef(0.5f, 0.5f, 0.5f);drawCube();}glPopMatrix();   glFlush();   ugSwapBuffers(uwin);}ok...I think that's all of it.  Through debugging, I'm pretty confident that the serialization functionality in SetupWorld works properly.  (A lot of this stuff has been included for your understanding)  The display function shows the room properly, and when I step through the "wall creation" code, SectorWalls[] is populated properly.  But, whenever I run the program, NOTHING ever collides.  Does anybody have an idea why??   
  Sorry you had trouble with the forums - they seemed to be having some problems a minute ago, so maybe it's related. Here's what I'd do:1. Use the 'edit' button and delete the previous posts.2. Repost with a description of the problem and some relevant code snippits.I can only speak for myself, but for me it can be difficult to find an error like you're describing in a large body of code without some effort (unless it just happens to pop out). There may be some more you can do in the way of debugging though to narrow down your question a bit. The first thing that comes to mind is to test the circle-line function in a controlled setting. Just create a single line and a single circle, and make it so you can move one or both of them around. Observing the results will help you determine whether the problem is with the intersection function, or elsewhere (e.g. level data, loading, etc.).   ;  Ok....I'm working on cleaning it up right now.  I'll make sure that my "clean" post is up before I delete these though : o P ...just in case someone's a complete genius at this stuff and can look at it and see what's wrong.   ;  ...btw, I tried my best to contain "this" (these lol) post(s) to as little bit of code as I could and still show enough of my code to be able to fully describe my problems.   ;  Ok.....if you've gotten this far *****THANK YOU!!!!!!****** I think one of the big problems I'm having is:  What do I need to do whenever my DetectCollision() function runs?  Using the formula that was provided on mathworld.com, if the discriminant of the formula is negative, then no collision occurs, but would I actually need to determine the intersection points otherwise?  I'm only wanting to handle collision detection with the borders of my "room" and prohibit the user from walking through the wall.  I'm pretty confident that my SetupWorld() works properly.  I included it for anyone trying to help that could possibly need it for clarification.  ...So, the endpoints of the walls are stored in the SECTOR taggedObj.  The sections of the code that I think are supremely important to my problems are: the keyboard handler and DetectCollision()   ;  No one will read code not in source tags spread across four posts. Most people won't read that much code anyway - try to cut it down to whatever reproduces the problem, rather than posting your entire application.   ;  The math&physics generally is not a code debugging forum. If you got some code, and don't know why it doesn't work, and can't make question apporiate for math&physics, don't post anything there. Maybe it's necessary to get back to tutorials and learn something about debugging.Now, try "edit" all your threads and select "delete". For threads that had replies and didn't get deleted, use "report this post to moderator" and in comment apologise and ask to delete thread.Then try to make apporiate question. If one doesn't spend time making apporiate questions, others don't spend time answering the questions. As rule of thumb, if question has more than 20 lines of source code, it is not relevant to this forum. I think it should be added to forum rules, btw.By the way, to post source, use [ source ] and [ /source ] tags. If you can't (your browser doesn't handle it correctly or something), don't post your code at all or get better browser.   ;  You might want to find a static situation. Place your circle in collision with a single wall (make your world a single wall) and debug to see why there-s no collision. There might be some small error, a sign, or something. Try to reverse the segment's direction. However you should take a pen and a paper and try to see why it should work. There is a relatively simple equation.   