Translation issues

Hello everyone,

I’ll apologize in the beginning for how basic this question is. It’s been bothering me forever. Well not that long because I haven’t been using openGL for but a few weeks.

I found a program that zoom, pans, and rotates a scene from It works great. I can add new objects and those all move around. Then I wanted to move one individual object instead of everything.

So I finally figured out that in the translation matrix I declare when drawing the shape, if I put in variables, I can change the coords of that particular shape by changing the values of the variables. So great. But now the problem comes that I can’t seem to get the right numbers to put into the variables for the shape. Trying to figure out what was done in this example and work backwards has helped a bit and I can get some numbers up there and objects can move when I click and move them, but they dont move in the right direction, nor do they move the right amount.

I’m wondering if anyone has seen this program before or might be able to point to the right place of where I can find some more information. I’ve tried looking through other posts here and I cant seem to find any answers.