PDA

View Full Version : adding constraint



Adrian116
01-13-2009, 09:02 PM
hello,

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:
http://www.cs.unc.edu/~dm/UNC/COMP236/Homeworks/hw1b/exec_demo_pc/robot1.exe

Thanks for attention

Regards

_NK47
01-14-2009, 02:57 AM
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.

Adrian116
01-14-2009, 04:57 AM
thx _NK47

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

_NK47
01-14-2009, 06:18 AM
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:
http://opende.sourceforge.net/mediawiki-1.6.10/index.php/HOWTO_rag-doll

keep in mind that this is not an OpenGL issue.