Browse Search Popular Register Upload Rules User list Login:
Search:
Texture Matrix

Image:
screenshot of the scene

Author: FRA32

Group: Default

Filesize: 182.41 kB

Date added: 2025-02-21

Rating: 5.6

Downloads: 412

Views: 175

Comments: 7

Ratings: 2

Times favored: 0

Made with: Algodoo v2.2.0b

Tags:

Scene tag

While digging through old scenes, I found a prototype of a scene that I decided to furnish up and upload as it is.

This scene demonstrates how the textureMatrix field works and how its fields are calculated. An interactive UI allows adjusting the translation, rotation, scale and shear of the texture and shows how these values combine into the final 9-field array.
Please log in to rate this scene
edit
Similar scenes
Title: How texture matrix, clamping works
Rating: 5.25
Filesize: 283 kB
Downloads: 427
Comments: 1
Ratings: 2
Date added: 2016/05/29 12:25:46
Made with: Algodoo v2.1.0
Rating: rated 5.3
download
Title: TEXTURE MATRIX DEMONSTRATION
Rating: 5.5
Filesize: 322.09 kB
Downloads: 1347
Comments: 2
Ratings: 2
Date added: 2012/10/28 17:55:52
Made with: Algodoo v2.0.2
Rating: rated 5.5
download
Title: Kutis Display 1.1 - NEW Ambi FUNCTIONS
Rating: 5
Filesize: 42.94 kB
Downloads: 515
Comments: 0
Ratings: 1
Date added: 2010/07/08 16:14:36
Made with: Algodoo before v1.8.5
Rating: rated 5
download
Title: AHOX Programmable MiniComputer with X7 CPU
Rating: 5
Filesize: 17.63 kB
Downloads: 658
Comments: 0
Ratings: 1
Date added: 2010/08/28 21:09:03
Made with: Algodoo before v1.8.5
Rating: rated 5
download
Title: AHOX Programmable MiniComputer with X7 R2 CPU
Rating: 5
Filesize: 32.1 kB
Downloads: 701
Comments: 0
Ratings: 1
Date added: 2010/08/29 11:57:09
Made with: Algodoo before v1.8.5
Rating: rated 5
download
Title: Textures and Sines
Rating: 5
Filesize: 6.27 MB
Downloads: 815
Comments: 0
Ratings: 1
Date added: 2020/04/29 20:43:50
Made with: Algodoo v2.1.0
Rating: rated 5
download
Hey FRA32 -- I'm glad to see that you're back on Algobox posting awesome scenes again! I hope you'll stay around here for a while. :tup:
Thanks. I've always struggled with, and never completely understood, textureMatrix. Your scene makes things a whole lot clearer.:tup:
@FRA32 -- Do you know what the last three array elements (shown with your comment "Never changes") are used for? I played around with them some time ago and I discovered that they do have a significant effect on the texture, but I was not able to determine what the effect actually is doing. Thanks!
FRA32,

Your mission, should you choose to accept it, is to simplify the code in Rotate 3D Cube. This tape will self-destruct in five seconds.
@Xray The last three elements of the texture matrix are technically the elements for a 3D transformation. This may seem confusing since the transformation matrix is meant for 2D textures, but it's actually a clever trick thats used to do stuff in 2D.
Specifically, the isssue those three elements solve are Translation. Translation is the shifting/moving of an object through space, and is usually done using vector addition. The transformation matrix is something that is multiplied however, not added, so a regular 2D matrix (2x2 elements) cannot perform translation by itself. To solve that, the matrix is expanded into a 3D transformation matrix (3x3). The two Translation coordinates of the right column are actually a Skew operation in the 3rd dimension, skewing the x/y axis with the "made up" z-axis. This allows creating translation from this made up 3rd dimension.
The side effect of this solution is the lower row of the matrix. Just like the right column converts the made-up Z-Axis into changes in X and Y (the 3D skew that is used as 2D translation), the lower row can convert X,Y and Z coordinates into Z-Coordinates. This is technically not useful to 2D textures, however when the texture matrix is applied, the resulting 3D vector is always "projected" onto 2D using x'=x/z and y'=y/z. Because of this, changing those last 3 elements causes somewhat wierd and unexpected changes to the image. The most intuitive effect I can explain is the final component of the matrix, the lower-right corner. Setting this one to 2 effectively doubles the Z-coordinate of the 3D texture coordinate. Because the projection divides by the Z coordinate, this effectively halves all image coordinates, thus sampling a smaller region of the image space, thus effectively "zooming" in on the image.
On that topic, I may upload a scene on projection soon, both the intuitive 3D projections, and the more unusual projections used for curved spaces.
Oh, that would be awesome!

I have a suggestion for that future scene if you haven't already considered it.... Please include some actual examples of texture images being translated, scaled, and rotated. I have been able to create a few pseudo-3D images (e.g., dice) in a few of my scenes, but I must admit that some of those scenes were only possible with help from s_noonan, and some were done by the seat-of-my-pants (trial and error) without truly understanding the math behind them. I need to learn more!!! :lol: