adding constraint


 I am new to opengl. For my project, i have done to draw a 3D robot arm in a MFC application by using glut. Now i am going to add some constraints so that the robot arm has some restrictions for the motion such that no arms collision, intersect etc. I think this should be easy to be done. What i am wondering is how to restrict the arm will not go through the ground which means that any part of coordinate(x,y,z) of the robot arm should be larger that 0. How can i do that?

here the link is the robot arm similar to mine for reference:

Thanks for attention


basically you need to compute bounding volumes from your objects which you can check against your plane or other objects for intersection. if your pivot point is somewhere in the middle it will automatically report collision and your x,y,z will stay over the plane. best fit for those arms and legs are oriented bounding boxes/capsules and i would suggest using some open source physics library like ODE or Bullet.

thx _NK47

would you mind to give me such kind of information?
since i have no idea which part of ODE library can help…

sorry, haven’t done anything what you need before. important to say that it isn’t that easy as it sounds, that’s why im suggesting some physics library. understanding the library is another thing. ODE is not that big and contains all classes and defines for immediate use, so try getting the latest (0.10.1) version and compile it. from there only some tutorials might help you. taking first steps is essential anyways if you want to achieve what you want.
this might be more related to your problem:

keep in mind that this is not an OpenGL issue.