Hello. Write a simulation of a spring with ODE and Panda3D for rendering. With a simple movement it's simple: the force is applied proportional to the distance is subtracted, the force is proportional to speed and the body gradually returns to a given point. If proportional speed read, the body performs harmonic oscillations in the vicinity of a given point. With the rotation and the moment... Neither rotation matrices nor their derivatives, or their arccosine and arctinus no result. In the best case, the body spins around 0Z in the worst does random spins and flies into space. To keep the specified angle, do not want in any.

The successful implementation of the rotation I don't consider the rotation only 0X and 0Y. The body get quarternion and make every moment proportional to X or Y. of course any deviation around the Z axis leads to the unwinding and space flight. If the body does not rotate around Z, the body successfully holds a specified angle after applying external forces.

How to calculate the torque necessary to rotate in the direction specified by the quaternion, the body adhered to a given angle?

The successful implementation of the rotation I don't consider the rotation only 0X and 0Y. The body get quarternion and make every moment proportional to X or Y. of course any deviation around the Z axis leads to the unwinding and space flight. If the body does not rotate around Z, the body successfully holds a specified angle after applying external forces.

How to calculate the torque necessary to rotate in the direction specified by the quaternion, the body adhered to a given angle?

asked September 26th 19 at 06:47

3 answers

answered on September 26th 19 at 06:49

You mean the inertia tensor? This is not a quaternion.

Thing catchy (yet familiar), but in fact completely analogous to linear mechanics: how do you get the vector acceleration by dividing the force vector on the inertia, as surely you get a vector of the angular acceleration by dividing the moment of the force vector on the inertia tensor. And no twitching of the left will not work - mother nature will take care of (with proper design of the inertia tensor, of course).

Thing catchy (yet familiar), but in fact completely analogous to linear mechanics: how do you get the vector acceleration by dividing the force vector on the inertia, as surely you get a vector of the angular acceleration by dividing the moment of the force vector on the inertia tensor. And no twitching of the left will not work - mother nature will take care of (with proper design of the inertia tensor, of course).

answered on September 26th 19 at 06:51

David Baraff in his lectures describes this whole thing:

www.cs.cmu.edu/~baraff/sigcourse/notesd1.pdf

The moment of inertia is a diagonal matrix, which is set in the time of the creation of the body. It's a sort of "mass" for rotational motion.

www.cs.cmu.edu/~baraff/sigcourse/notesd1.pdf

The moment of inertia is a diagonal matrix, which is set in the time of the creation of the body. It's a sort of "mass" for rotational motion.

Thanks, found this book. Read again.

Unfortunately, neither the formula nor the sample that would have led me to the solution I found. Body stubbornly spins around its axis 0Z and blasts off to outer space. commented on September 26th 19 at 06:54

Unfortunately, neither the formula nor the sample that would have led me to the solution I found. Body stubbornly spins around its axis 0Z and blasts off to outer space. commented on September 26th 19 at 06:54

answered on September 26th 19 at 06:53

The idea is I just need to know what the angle of the quaternion forms with the coordinate axes. Just how to do it?

A quaternion is a very abstract thing. Still like to ask "what is the angle it forms with the coordinate axes, the number of purple color". You mean "how to find Euler angles from the orientation quaternion of the specified kind"? commented on September 26th 19 at 06:56

Find more questions by tags C++MathematicsmechanicPhysicsPython

I understand that the dampers are red and lemon axles(springs) you did fine. But the damper for the blue gives you a strange reaction. So? - anahi_Monahan commented on September 26th 19 at 07:10

⃗α=⃗M/Ix - anahi_Monahan commented on September 26th 19 at 06:52

Q0 is a unit quaternion, that is, zero turn (where? what is the initial orientation for all turns, including zero?), that is nowhere in particular, the body 1 is not rotated, not exactly clear where it is generally turned off. Then begins the hurdy-gurdy. While I can imagine that the center of the body 1 is the center of rotation of the body 2. The ball joint has 3 degrees of freedom in all three planes. That is not restrict the body 2 in any way, except distance to the center of rotation. The body 2 can be rotated as anything and even anyone. And where are you spring-neeku put in? And what is Q? Q0 you defined as zero rotation, and Q (I suspect - also a quaternion) is not determined, then there is every possible direction. Then there restricts "any possible direction of the body" to anyone - is not clear. You should at least cernovice shemki planted... To your design to see one eye. - anahi_Monahan commented on September 26th 19 at 07:04

i67.fastpic.ru/big/2014/0730/bc/46a217b24553e9af9d...

This whole Saga stems from the fact that in Open Dinamic Engine, which calculates physics, yet support restrictions. This disadvantage I decided to fix writing a library that calculates the reaction of the springs. - deangelo.Stokes commented on September 26th 19 at 07:07