Silly questions and confusion by transformation matrices in OpenGL

As I said, I can see how thinking in-order can be more intuitive. But I have a problem with this:

There’s a conflict between what you describe and the actual math. Say the flowerpot rests at +10 on the x-axis. If I were moving objects around, I’d do a glTranslatef(-10.0f, 0.0f, 0.0f). Instead, I have to do a glTranslatef(10.0f, 0.0f, 0.0f), that is, I’m moving the origin to the object and not the object to the origin. Not sure if I explain to correctly, but you’re still visualizing one thing and writing code that does the opposite.

I too prefer to think in terms of what happens to the object, inside its parent coordinate frame. With your model I have to think about what happens to the coordinate frame instead, the math forces me to.

Apparently I fail to explain it properly.

When I said I move the flowerpot around, I do that in its local space. Which means that I really move it +10 units over the (local!) x-axis, when performing a translate(10,0,0) operation.

Hence in the mental visualization, I don’t bring the origin to the flowerpot, I move the flowerpot and make that the new origin.

There is no conflict between that model and the math.

‘moving the origin to an object’ has no analogy in reality. It’s an abstract concept. I try to avoid that, as most people struggle to grasp it. I either explain it using a solar system, or a robot arm (which is more complex, as there are more axes to rotate around). To move from the joint of a the origin robot arm to the joint at the end of it, I do mat.translate(armLength, 0, 0) and that’s where the origin of the next (child) robot arm is, which can be rotated, followed by another translate, which creates the origin for the next arm, etc. Nowhere are we ‘moving the origin to an object’, no, that would indeed mean a negative translate, which is what I’m trying to explain now for 3 posts, is nowhere near what I am saying, and doesn’t conflict with the math - or it wouldn’t work, obviously.

I guess I’ll have to make a video to explain my trivial mental model. :slight_smile:

Hey Riven,

, long posts color clip weirdly.

On a related note, Matricisies™ are non-intuitive and REQUIRE trial and error to get a feel for them imho.

It’s all about points in space and how we can manipulate them in useful ways after all.

Something only requires trial and error if you do not grasp the underlying concepts (which ever way you visualize them).

You say that as if it has any relevance in anything other than to scare newbies :V

As a said somewhere else recently, I think people are better off learning basics of coord frames & vectors first. Otherwise your skipping a step.