I would like to set the speed of my Box2D revolute joint on every update such that it rotates to a desired angle and stops. It should ramp down as its angle approaches the desired angle.  My first thought was just to set the speed to +max or -max based on the difference between the current angle and the desired angle. However, I think this might cause a see-saw effect as the joint overshoots its target angle.  What torque should I apply (each tick) to a joint to achieve a rotation to a specific angle and then rest?
55203
I'm trying to make the joint rotate smoothly around the center of the canvas, toward the angle of mouse pointer. What I have works, but I want it to animate the shortest distance possible to get to the mouse angle. The problem occurs when the value loops around at the horizontal line (3.14 and -3.14). Mouseover that area to see how the direction switches and it takes the long way back around.  Relevant Code   // ease the current angle to the target angle joint.angle += ( joint.targetAngle - joint.angle ) * 0.1;  // get angle from joint to mouse var dx = e.clientX - joint.x,     dy = e.clientY - joint.y;   joint.targetAngle = Math.atan2( dy, dx );   How can I make it rotate the shortest distance, even "across the gap"?
22402
I've learned that the torque on an object is just $ \text{perpendicular force}\times\text{radius}$ and that has worked well for things like seesaws but it doesn't take into account the torque of the object itself!    In the picture the rod has a total mass of 5kg, and by definition the torque on the right is greater than that on the left.  $$T=Fr$$   I am supposed to solve the question     What distance to the left of the fulcrum (triangle supporting the rod) would I have to put a 3kg weight to balance the rod?     I've tried calculating the net torque $T_{net} = I\alpha$ but I don't really know how to approach this. I'm looking for an explanation more than an answer.
97669
The space ships in my game a meant to be player-built with an arbitrary amount of thrusters attached anywhere with any rotation. I currently have some dirty code to rotate the ship to a given angle (accelerating and decelerating).   Here's an example of a symmetrical ship facing where the red line points, being told to rotate left.    However, as you would imagine, depending on where the player has put the thrusters, sometimes undesired linear forces are affecting the ship. In this case, the ship starts moving forward.  I'm elaborating on whether it's possible to find the maximum thrust a thruster can apply to cause no linear velocity. (In the above case that would be none since there's nothing to counteract the forces from the rear thrusters, and the front ones kill eachother).  What I've come up with so far is a formula to determinate the "turn efficiency" e.g. how much rotation is caused in relation to linear movement.  a - position vector to thruster a b - position vector to thruster b v1 - force from thruster a v2 - force from thruster b  efficiencyDelta = a.cross(v1) / |v1|  -  ( a.cross(v1) + b.cross(v2) ) / |v1 + v2|  , basically "a.cross(v1 * t) / |v1|" is supposed to be the turn efficiency. And then we subtract it by the turn efficiency of the thrusters combined, to see if firing the new thruster is worth it.  Problem arises when I realize that thrusters aren't surposed to be on/off, but can vary their thrust from 0 to 1. And how to go about when the player wants the ship to go forward. Ofcourse, there would need to be a balance of how much to rotate/move.  I'm no rocket scientist so I'm hoping there's someone who can tell me if it's even possible to calculate the throttle of each thruster this way and give me a push in the right direction.  Thank you for taking the time! / Kim
45983
Let's say I have a shape that I rotated at an awkward angle of let's say 34°. I close the document, return a few hours later, and want to straighten the it back to its original 90° or 0° angle. The problem is I don't remember the angle I originally rotated it at. Shift + Rotating nor resetting its bounding box does the trick. Any shortcuts/options I'm overlooking here? For example how would I rotate this quadrilateral so that it sits horizontally straight and looks like a box.
116274
I want to edit a mesh of a rotated object in pose mode.  But when I select a rotated object with edit mode, it is restored to its original condition. I want to make an animation process of folding, so I could't press apply button after rotated armature. Please give me an advice.
17541
I am wondering if there is a limit to rotational speed of an object just like there is one for translation speed ? what are the implications of general relativity for rotating objects ?
97608
I'm trying to understand the derivation of the torque equation $\vec{r} \times \vec{F} = I \alpha$. My textbook derives this easily enough from Newton's 2nd Law for a single point with mass $m$ and  radial distance $r$, with the force applied at the same distance $r$, as (if we drop the vector notation for simplicity) $F=ma=m(r\alpha)$, so $rF=mr^2 \alpha = I\alpha$. (Note, there are both 'ay's and 'alpha's there; they look similar.)  The textbook stops there and concludes that the equation holds for any rotating body. But then I tried this derivation for two points positioned along a rigid, massless rod (which points perpendicular to an axis about which it rotates). If there's a point-mass $m_1$ a distance $r_1$ from the axis of rotation and another point-mass $m_2$ at a distance $r_2$, and the force is applied at (for example) distance $r_2$, I get $F=m_1 a_1 + m_2 a_2 = m_1 r_1 \alpha + m_2 r_2 \alpha$, so  $r_2 F= (m_1 r_1 r_2 + m_2 {r_2}^2 )\alpha$. But $m_1 r_1 r_2 + m_2 {r_2}^2$ isn't the correct value for $I$ here. What am I missing?
30849
at point no. 2 in the diagram, let the object accelerates to a velocity v1 (just along the direction of the slope) due to rolling down the ramp. Now, v1 has a x-component as well as y-component.  Now, my question is:  In the diagram, In between the points no. 2 and 3, the object passes over a horzontal distance.  During this part of motion, which statement of the following is true:  i)  the magnitude of the velocity remains constant, i.e. equal to v1, and only the direction changes.  or, ii) the magnitude of the velocity changes, in such a way, that only the x-component of v1 remains still; whereas, the y-component of v1 completely vanishes,  as soon as the object leaves the ramp and gets onto the horizontal trajectory(between the points marked 2 and 3).
104132
I have a sprite that moves from waypoint to waypoint. It turns to face its velocity vector, but not instantly (there's a rotation speed).  The problem I'm having is, from one direction to another, the sprite will often turn in wild, unnecessary ways instead of appearing like you might expect a car to appear (turn such that the minimum delta in angle occurs).  Right now I'm using the following formula to calculate the rotation float for the current velocity:  MathHelper.PiOver2 + -Math.Atan2(anotherVector.Y - vector.Y, -(anotherVector.X - vector.X));   And then I lerp the current rotation by the new rotation by the rotation speed (10f):  rotation = MathHelper.Lerp(rotation, targetRotation, 10f * (float)gameTime.ElapsedGameTime.TotalSeconds);   But unfortunately, it's causing the sprite to spin in wild directions before reaching the correct angle. Any suggestions?
79472
Well I have a simple 2D game where all positions are defined by and X and Y coordinate.  There are objects moving at a constant velocity. And a turret fires a bullet at the X and Y coordinates of the object. By the time the bullet goes to the desired area, the object has already moved.  So i need to adjust the X and Y target positions for the turret to shoot at taking into account the bullet speed and object speed.  Here's an image showing the problem.
9612
We have to rotate a rectangle along the circle at an angle $\theta$ and then move the rectangle along the tangent for a distance 'lateral offset' as given in the following image  I calculated the lateral offset factors to be applied on the rectangle (after rotating it) coordinates as given below. Reference -          Slope = tan(θ);         SlopeLateralOffset = -1.0 / Slope;         LateralOffsetTranslationFactor = LateralOffset / sqrt(1.0 + SlopeLateralOffset  * SlopeLateralOffset);          LateralOffsetTranslationX = LateralOffsetTranslationFactor ;         LateralOffsetTranslationY = SlopeLateralOffset  * LateralOffsetTranslationFactor ;  Is the logic that I applied correct? I think that the formula SlopeLateralOffset = -1.0 / Slope, will not work always as I cannot form a right triangle with radius r and lateral offset What changes should I make it to work? Can you please help me?
123572
Problem #25 from the 2009 $F=ma$ contest:     Two discs are mounted on thin, lightweight rods oriented through their centers and normal to the discs. These axles are constrained to be vertical at all times, and the discs can pivot frictionlessly on the rods. The discs have identical thickness and are made of the same material, but have differing radii $r_1$ and $r_2$. The discs are given angular velocities of magnitudes $\omega_1$ and $\omega_2$, respectively, and brought into contact at their edges. After the discs interact via friction it is found that both discs come exactly to a halt. Which of the following must hold? [...] Ignore effects associated with the vertical rods.   Diagram here:     Probably conservation of angular momentum is useful here, but I am not clear how it can be applied. There are two distinct axes of rotation, one for each disc, so we cannot talk about conservation of angular momentum about one axis. If the two disks rotated about the same axes then the solution is straightforward, but this is not the case.
26772
I have an intuition problem  calculating torque using the cross product formula.  As for example let the magnitude of the force be 50 lbs and length of the  wrench be one foot and you are exerting force in a clockwise motion and the angle you apply the force 60 degrees.  This is an example so I can ask my question.  Using the right hand rule the torque points  perpendicular to the force you are applying to the bolt. In this case since the sine of 60 degrees is about .86 it would be (.86)(50) foot lbs. How can the bolt turn clockwise if the force is concentrated perpendicular to where it needs to turn?  The cross product formula demands the torque be perpendicular. Obviously my mistake but I don't see where.
21483
I'm trying to fold a cube with an animation. I've tried inverse kinetics with no luck. Here are some images that explain what I'm trying to do. I'm trying to make this so that    when the upper bone is pushed down, the box is folded to the ground. when the upper bone is pulled up, it unfolds the box.
61548
I have a cylinder here.    And I want to rotate its end vertices along Y to create something like a Bamboo with a slanted end like in this image:     But trying to rotate them, the cylinder's diameter gets shortened at the end and the face turns into an oval from a circle. I want the entire cylinder to be of same diameter until the very end face, which should be slanted and yet circular.    Can this be done by using rotation at all?
20967
How can I setup the Bevel modifier to only work on 30 degrees angle and avoid pinching at the same time on convex shapes?    I want to avoid pinching generated on concave shapes to replace the manual edge loops or sharp edges workflow for hard surface models:
116666
How can I keep the rotation values within a range of 0 to 360° no matter how many times I actually rotated an object? I need this as a value for a driver variable.  For example 945° => 225°.