Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Explanation of PF_FloatMatrix?

Contributor ,
Mar 13, 2021 Mar 13, 2021

Could someone explain how exactly the float matrix works? Does each index of the matrix control a different transformation property, or is it different than that?


Through experimentation I have found the following to contain y and x transformations (through using transform_world()):

[xTranslation, ?, ?]

[?, ?, ?]

[?, ?, yTranslation]

TOPICS
How to , SDK
677
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 14, 2021 Mar 14, 2021

there is no "current transformation" to a Transform world. it transforms the imput image according to the supplied matrix, and the result is transformed along with the layer.

 

rotating an image using a 3X3 matrix involves placing sin and cos (and negative values) in certain places in the matrix. this is common practice in 2D and 3D graphics, and you can find literally hundreds of tutorials and code samples in a google search. the AE transformation matrix is no different from what you'll find in

...
Translate
Community Expert ,
Mar 13, 2021 Mar 13, 2021

If the property you are trying to control has 2 values, like the position of a 2D layer, then the array is like this: [x, y]

 

If the layer is 3D then the array is 3 values [x, y, z] so an expression that returns [960, 540, 0] would position a 3D layer's anchor point at the center of an HD comp's world. 

 

If your expression is for color then the array, not a matrix but an array, always contains 4 values for red, green, blue, and alpha. Those values range from 0 to 1 which corresponds to the decimal values used in a 32-bit workspace. That means that this array [.5, .5, .5, 1] would return a 50% gray color and [1, 0, 0, 1] would give you red. If the color property supports transparency then an array like this [.8, .2, .9, 0] would give you a completely transparent layer but if it was a fill color you would get a shade of magenta. 

 

If that is not what you are looking for we need a lot more details. I'm not really sure what you are referring to when you talk about the Float Matrix.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 13, 2021 Mar 13, 2021

it's a standard thing in graphics.

https://en.wikipedia.org/wiki/Transformation_matrix

 

just note that AE's matrices are row based, so you'll need to swap the axis for everything to land where AE expects it to. (i think it' the opposite of the openGL standard)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 14, 2021 Mar 14, 2021

I know what a matrix is but I have no idea what the OP is trying to accomplish. No code sample, no explanation of the goal. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 14, 2021 Mar 14, 2021

My goal is to understand how to use a transformation matrix in tandem with transform_world() to be able to make transformations to my PF_EffectWorld. In particular I wasn't sure if each index of the matrix represents a certain transformation property, or how it works. I can already move my image using arbitrary values in the configuration above, but doing things like rotation seem to be a bit more complex.

 

@shachar carmi Another question along the lines of how to say rotate using this method, is the matrix applied based on the current transformation setup of an EffectWorld, and it sort of moves it accordingly?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 14, 2021 Mar 14, 2021

there is no "current transformation" to a Transform world. it transforms the imput image according to the supplied matrix, and the result is transformed along with the layer.

 

rotating an image using a 3X3 matrix involves placing sin and cos (and negative values) in certain places in the matrix. this is common practice in 2D and 3D graphics, and you can find literally hundreds of tutorials and code samples in a google search. the AE transformation matrix is no different from what you'll find in these tutorials and code samples, with the exceptsion that it's lines and rows are swapped to what is generally used.

the wikipedia link i sent would be good starting point to find what to look for in your serached.

3X3 matrices can translate, rotate, scale and skew an image, all in one concatenated matrix. actually, the standard AE effect "transform" does just that.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 14, 2021 Mar 14, 2021
LATEST

Thank you for the information, reference, and sdk insight to the transform effect!~

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines