Search Unity

Question Is there a way to find rotational differences between two UV coordinates?

Discussion in 'Shader Graph' started by PinguPongu, Mar 17, 2023.

  1. PinguPongu

    PinguPongu

    Joined:
    Feb 2, 2021
    Posts:
    23
    Hi!
    So I have two UVs I want to compare. One is just a normal UV, and the other is the world space coordinates, broken down into its X and Z values. In other words, a vector2 that is projected from the Y axis.

    For sake of simplicity I will call the normal one UV1 and the world space one UV2.

    Now, when I add in a default plane and resets its transforms, UV1 and UV2 have no difference in rotation. In other words: they both point into the same directions.
    But as I rotate the plane on the Y axis, UV1 starts rotating away from UV2, and the angle between the UV's gets bigger.

    I really hope that this is at least somewhat understandable. :confused:

    Is it possible to calculate the angle formed between them in Shader graph?

    Thank you!
     
  2. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,313
    Not sure I am able to answer this, but I think you should provide more informations or some picture. I understand the question in some way, but my answer makes no sense, so either I understood that wrong or you want to do something simple in complicated way, so it might be good idea to explain what you are trying to achieve.