Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

210
Views
Rotar cuaternión en Libgdx

¿Cómo rotamos un cuaternión en libgdx alrededor de un cierto eje?

 var rotation = new Quaternion().setEulerAngles(0.0f, 0.0f, 90.0f); // How do we rotate that quaternion around X axis 90 degrees ?
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Rotar un cuaternión significa: multiplicar otro cuaternión a la derecha o a la izquierda de su cuaternión original (dependiendo del espacio que desee rotar). Si, por ejemplo, desea que un vector primero gire 90 grados alrededor del eje X, seguido de 90 grados alrededor del eje Z, esto se puede lograr con el siguiente código:

 // your quaternion (rotation of 90 degrees around Z axis) Quaternion rotation = new Quaternion().setEulerAngles(0, 0, 90); // quaternion expressing rotation of 90 degrees around X axis Quaternion x90deg = new Quaternion().setEulerAngles(0, 90, 0); // concatenation (right-multiply) of the X rotation with the Z rotation Quaternion result = new Quaternion(rotation).mul(x90deg); // test: rotate (0, 0, 1) around X axis 90 deg, followed by Z axis 90 deg // the first rotation will yield (0, -1, 0), and the second rotation (1, 0, 0) as a result Vector3 v = new Vector3(0, 0, 1); result.transform(v); // v = (1, 0, 0)
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!