Timeline for How to determine which thrusters to turn on to rotate the ship?
Current License: CC BY-SA 3.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 27, 2012 at 8:34 | comment | added | migimunz | @RussellBorogove, it seems I've forgotten to include a preloader. I'll fix it as soon as I'm home. | |
| Oct 27, 2012 at 1:36 | comment | added | Russell Borogove | I got a JSON parse error the first time I tried to run your live demo; on reloading the page it worked ok. | |
| Oct 26, 2012 at 12:38 | comment | added | Joren | The reason why it works is easy to see intuitively: r dot F = r F cos θ. If you rotate r counterclockwise by 90 degrees and take the dot product, you get r F sin θ because cos (θ - 90˚) = sin(θ). | |
| Oct 26, 2012 at 12:30 | comment | added | Joren | What you want to do to avoid angle calculations is to use the perpendicular dot product (derived from the cross product definition of torque T = r cross F if you use 3D vectors with z = 0). You take the vector (-ry, rx), which is perpendicular to r with the same magnitude, and you calculate the dot product of that vector with F. The result is T = rx * Fy - ry * Fx. Then abs(T) is the magnitude of the torque, and its sign indicates direction: T > 0 is counterclockwise, T < 0 is clockwise. | |
| Oct 26, 2012 at 6:32 | comment | added | migimunz | @TrevorPowell, exactly. For the sake of simplicity (and also fun, since how well your ship performs will depend on how well you design it), I decided that thrusters are either on or off. I will probably include a threshold so that those that cause too little torque (and therefore too much lateral movement) are not turned on, but exactly how much is "too much/little" will probably be determined by trial and error. | |
| Oct 26, 2012 at 4:51 | comment | added | Trevor Powell | I don't think that's anything to do with this logic. There's nothing here to ensure that the vehicle doesn't receive a net translational force from firing the set of thursters selected by this mechanism. If maintaining no net translational force is a requirement, it will require being able to modulate the force of individual thrusters (and will probably become a much more difficult problem to solve) | |
| Oct 25, 2012 at 22:23 | comment | added | House | Nearly there I think. It seems to not be exactly at the center of mass. Using only the left/right arrows the ship can easily go off screen. Very close though. Perhaps the point you're measuring from is slightly off. Or it could be a timing issue since it seems to stabilize into a good spin after a while. Nice work though. | |
| Oct 25, 2012 at 21:10 | history | answered | migimunz | CC BY-SA 3.0 |