-
I'm trying to use the Intuitively, applying a y-flip should be possible by applying matrix
i.e. ExampleWhen The expected behaviour is to flip the texture vertically. Setting I also tried all possible logical alternatives & transposes of Reproductionmesh.obj
scene
I'm using 3.3.0 version. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Hi @georgy95 In the Does this work as you'd expect? |
Beta Was this translation helpful? Give feedback.
-
There are multiple ways to achieve the desired result: auto-flipping on the mesh level or the bitmap level, I was more curious about achieving the same transformation on From my understanding the the uv transform is calculated from I understand that perhaps not an important discussion as there are multiple ways of achieving the desired result, as you mentioned. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Apart from Y-flipping, I'm also interested in rotations around the center and other transformations. The following matrix should rotate the texture 180 degrees around the center:
This should result in a map |
Beta Was this translation helpful? Give feedback.
-
This is it, thank you. The mis-understanding came from the docs:
And I assumed that it had to be padded with 0s, since the 4th column/row would be the one ignored. But it's actually used. I could make a PR if you wish to change the wording. |
Beta Was this translation helpful? Give feedback.
I tried it with
y_flip = mi.ScalarTransform4f().translate([1, 1, 0]).rotate([0, 0, 1], 180)
which is equivalent to what you wrote and it worked as expected.
I think all of this is a bit confusing if you try to initialize the matrix with a
Transform4f
when in reality the underlying matrix has dimensionality 3. You can double-check your matrices withmi.traverse(scene)['backwall.emitter.radiance.to_uv']