Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to add two quaternions dots

Discussion in 'Scripting' started by l33t_P4j33t, Feb 17, 2020.

  1. l33t_P4j33t

    l33t_P4j33t

    Joined:
    Jul 29, 2019
    Posts:
    232
    I can't for the life of me understand what the heck a quaternion even is. and there is no functionality in the Unity.Mathematics class to convert from quaternion back to euler inorder to add them normally.
    I just want to make a system where i can rotate an object by float3 euler angle degrees every frame
     

    Attached Files:

  2. csofranz

    csofranz

    Joined:
    Apr 29, 2017
    Posts:
    1,556
    I thought multiplying two quaternions does that. And have you tried. Quaternion.eulerAngles()?

    Also, I think Quaternions express Rotation values, and therefore I'm not sure what your question (add two dots) Rally means,
     
  3. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    Because to multiply those, you need to use:
    Code (CSharp):
    1. math.mul(q1, q2)
    * operator on quaternion is probably not existent, haven't checked that.

    Probably its done for the Burst to translate that to something more optimized.

    To specify angle on specific axis - use:
    Code (CSharp):
    1. quaternion.AxisAngle(*yourAxis*, *your_angle*);
    This might come in handy as well:
    https://github.com/Unity-Technologi...ob/master/src/Unity.Mathematics/quaternion.cs

    Also, its better to ask questions regarding DOTS on the DOTS subforum.
    Higher chance of getting answers related to DOTS there.

    He means DOTS.

    Which has its own shader like mathematics library.
     
    orionsyndrome likes this.
  4. l33t_P4j33t

    l33t_P4j33t

    Joined:
    Jul 29, 2019
    Posts:
    232
    ah thanks man it works now
     
  5. orionsyndrome

    orionsyndrome

    Joined:
    May 4, 2014
    Posts:
    3,070
    Although I understood it, he could've said so himself. Also he could've typed DOTS in uppercase.
    Otherwise it's just confusing, because a dot in the context of linear algebra is definitely something that isn't DOTS.
     
    xVergilx likes this.
  6. Druder

    Druder

    Joined:
    Aug 20, 2022
    Posts:
    1
    You've tried to do it with animations