question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

It seems impossible to model angular momentum using Euler angles.

See original GitHub issue

Hi there. I tried to start a discussion in the forum, but my post was auto-flagged (as spam), and hasn’t been cleared (I’m a new user there), so I wasn’t able to find out more before posting here. I’ve probably misunderstood something (I’m pretty new to 3D graphics), but it seems impossible to (directly) rotate objects in Three.js, based on angular momentum, as the Euler objects used to represent orientation will (no matter which order they use) always rotate around one axis in worldspace.

Imagine a first-person space game with basic Newtonian motion. The camera/ship should just drift (and rotate) through space, until some force is applied etc. The following (simplified) example doesn’t work (in Three.js), as camera.rotation is an Euler instance:

const [velocity, momentum] = [new Vector3(), new Vector3()];

const update = function() {
    camera.position.add(velocity);
    camera.rotation.add(momentum); // this is invalid
};

I can use rotateX, rotateY and rotateZ to add each component of momentum separately, but have read that that is deprecated, and I should use Euler angles instead. That doesn’t seem possible here, as I need everything to be local (relative to the camera), and rotation using Euler angles always implies one non-local axis (if I understand correctly, which isn’t especially likely).

I’d be grateful if somebody could help me figure out what I’m missing. I just need a pointer really. I’m happy to do the homework myself. What am I not getting?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
Mugen87commented, Jul 21, 2022

I’ve raised your trust level by 1. Hope everything works as expected now.

0reactions
7ombiecommented, Jul 21, 2022

@Mugen87 - Thank you. The forum post seems to be lost, but I was able to figure it out (thanks to @LeviPesin’s comment) anyway, so it’s no problem. My issue is fixed, and the forum is working. Thanks again, guys.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rotational motion of rigid bodies
1.2 Angular velocity. The change of any vector r embedded in a rigid body due to an infinitesimal rotation and the corresponding.
Read more >
Euler Angle Rates & Angular Velocity - YouTube
Space Vehicle Dynamics ☀️ Lecture 14: Euler angle rates are not equal to the angular velocity. We derive the relationship between them ...
Read more >
Euler Angle Simulation with MATLAB - YouTube
Space Vehicle Dynamics Lecture 16, part 1: How does a time-varying angular velocity affect the orientation of a rigid body?
Read more >
Euler Angle - an overview | ScienceDirect Topics
The Euler angles used in the simulation, which define the relative orientations between the principal axis system (PAS) of the dipolar and quadrupolar ......
Read more >
Projection of angular momentum via linear algebra - OSTI.gov
Angular momentum projection is typically accomplished by a three-dimension integral over the Euler angles. [1, 2], using a complete, orthogonal set of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found