docs.unity3d.com
    Show / Hide Table of Contents

    Matrix Split Node

    Description

    Splits a square matrix defined by input In into vectors. Output vector dimension is defined by the dimension of the input matrix.

    The dropdown on the node can be used to select whether the output values are taken from the rows or columns of the input matrix.

    • Row : Output vectors are composed of matrix rows from top to bottom.
    • Column : Output vectors are composed of matrix columns from left to right.

    An input matrix of type Matrix 2x2 or Matrix 3x3 will return 0 values in the rows (or columns, depending on dropdown selection) that are beyond their dimension.

    For example, connecting Matrix 2x2 type to input In will return the correct Vector 2 type outputs to output slots M0 and M1, leaving outputs M2 and M3 to return 0 values.

    Ports

    Name Direction Type Description
    In Input Dynamic Matrix Input value
    M0 Output Dynamic Vector First row or column
    M1 Output Dynamic Vector Second row or column
    M2 Output Dynamic Vector Third row or column
    M3 Output Dynamic Vector Fourth row or column

    Controls

    Name Type Options Description
    Dropdown Row, Column Selects how the output vectors should be filled

    Generated Code Example

    The following example code represents one possible outcome of this node.

    float2 _MatrixSplit_M0 = float2(In[0].r, In[0].g);
    float2 _MatrixSplit_M1 = float2(In[1].r, In[1].g);
    float2 _MatrixSplit_M2 = float2(0, 0);
    float2 _MatrixSplit_M3 = float2(0, 0);
    
    In This Article
    • Description
    • Ports
    • Controls
    • Generated Code Example
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023