rok92 0 Newbie Poster

Hi Guys,

So I am trying to use C++ and openGL to create a simple robot arm that will follow a traget on the screen. I am to use Inverse Kinematics and more specifically the Cyclic Coordinate Descent Algorithm. I have found a few different ways to implement this although all involve having the X,Y,Z coordinates for my links and end effector.

The problem is I do not know how to obtain and store these coordinates, I have completed the most part of the program and have drawn the arms and target, and can move them with keyboard controls. Could someone please help here?!

Thanks!!

This is the simple code I use (I am new to all this) to create each arm. Obviously I use the translate function to move on to draw the next arm.

glPushMatrix();
//All for first stage of arm
glTranslatef(-2.0, -1.5, 0.0);
glRotatef((GLfloat) shoulder, 0.0, 0.0, 1.0);
glutWireSphere(0.4,10.0,8.0);
glTranslatef(1.0, 0.0, 0.0);
glPushMatrix();
glScalef(2.0, 0.4, 1.0);
glutWireCube(1.0);
glPopMatrix();

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.