I've avoided interactive graphics for a long time, but now exploring GEM for a class about nine months down the road. (Actually, I've used GEM for some basic webcam analysis, but that project didn't involve any geometry or texture mapping.)

So I created a [gemhead] --> [pix_image] --> [pix_texture] --> [rotate] --> [translateXYZ] --> [sphere] patch (with a bunch of sliders to mess around with the rotation and translation, and a line generator to act as a phasor for rotation angle). With that, I get the image spinning around the sphere *and* the sphere's position rotating around some axis.

Then I reversed the rotation and translation: [gemhead] --> [pix_image] --> [pix_texture] --> [translateXYZ] --> [rotate] --> [sphere]. In this arrangement, the translation parameters affect the position of the sphere, but the sphere is stationary and the rotation angle affects only the image mapping.

I would have expected: translate first, then rotate, would offset the sphere away from the rotation axis and then the rotation would affect position. Likewise, rotate first, then translate, would rotate the texture mapping and then position the sphere according to translation.

But I get the opposite. So, I'm not understanding something -- either about the order of operations, or the way that the operations are applied.

I have a feeling the answer to this question will take me several steps further -- best to get these concepts right at the beginning.

Thanks!

hjh

I've avoided interactive graphics for a long time, but now exploring GEM for a class about nine months down the road. (Actually, I've used GEM for some basic webcam analysis, but that project didn't involve any geometry or texture mapping.)

So I created a [gemhead] --> [pix_image] --> [pix_texture] --> [rotate] --> [translateXYZ] --> [sphere] patch (with a bunch of sliders to mess around with the rotation and translation, and a line generator to act as a phasor for rotation angle). With that, I get the image spinning around the sphere *and* the sphere's position rotating around some axis.

Then I reversed the rotation and translation: [gemhead] --> [pix_image] --> [pix_texture] --> [translateXYZ] --> [rotate] --> [sphere]. In this arrangement, the translation parameters affect the position of the sphere, but the sphere is stationary and the rotation angle affects only the image mapping.

I would have expected: translate first, then rotate, would offset the sphere away from the rotation axis and then the rotation would affect position. Likewise, rotate first, then translate, would rotate the texture mapping and then position the sphere according to translation.

But I get the opposite. So, I'm not understanding something -- either about the order of operations, or the way that the operations are applied.

I have a feeling the answer to this question will take me several steps further -- best to get these concepts right at the beginning.

Thanks!

hjh

I haven't delved any further than that idea, but the deeper understanding you are looking for will be found here....... https://puredata.info/community/conventions/convention04/lectures/tk-zmoelnig/gemrender.pdf

David. ]]>

You are correct, except that in GEM you should think of the data travelling UP the chain to the [gemhead].

Thanks! It may take me some time to wrap my head around this fully, but that and the PDF set me in the right direction.

Much appreciated!

hjh

[rotate] -> [translate] first rotates the entire coordinate system, and then translates the object along the rotated system. So if I'm changing the rotation, the object's visible position changes, relative to the origin.

(My mistake was that I was thinking of it in terms of rotating and then translating the *object* -- but that's not it at all. The object itself is always centered at 0, 0, 0 and never rotated relative to the coordinate system -- but the coordinate system itself changes, subject to [separator] etc.)

[translate] -> [rotate] first repositions the origin, and then rotates everything around the new origin. So an object positioned at the (translated) origin appears to be stationary but rotating.

This is not evident when placing only one object in the coordinate system, but becomes obvious when there's more than one.

OK. It makes sense now.

hjh

]]>