Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 02 Apr 2008
Offline Last Active Today, 05:38 AM

Posts I've Made

In Topic: Destructiblity: 2D voxel (okay, pixel) physics

03 April 2016 - 12:50 PM

Do you know Cortex Command from Data Realms? It has some very nice pixel physics going on - maybe if you contact them, they will let you in on their methods?

In Topic: Rope and sails?

22 January 2016 - 02:02 AM

yeah code would be good, as i mentioned earlier i need to simulate rope not sail, sail only moves rope that is attached to some fixed non movable end points (to make it easier), so then i can calculate the maximume translation of rope points between those two endpoints and fix cloth poisition. - wait i maybe wrote that wrong ;x - consider rope is undestructable it will bend somehow to some value and rope length wont change, this will help me position the cloth.


lets say i have a  rope that has 4 control point two fo them are end points that are not movable, now i apply a force to one of movable points lets say 1 million kilojoules (it should crack but dont mind our rope has godmode on) now those two control points will move only to some value and they wont deattach.


in my case ill do that: move cloth by wind, then whenever cloth point is attached to rope, check if it extends the rope ability to be bend and if yes correct the position of rope and cloth


Hello again! Simulating rope and sail are very similar, since a sail would simply be a tri- or quad-mesh of interconnected point masses and springs. Also, things doesn't work like you describe above. The ropes hold the sail up via the mast or masts, and transfer the wind-force applied on the sail to the hull of the ship. There are no "fixed points" that doesn't move. If your ropes are so soft and rubbery that they can't be used to propagate forces (that's what it looks like), then your simulation won't work. If you want a real physics simulation you'll have to start by reading up on how sailships work, because it's not as simple as you appear to think it is.


As for the problems you experience with your ropes: it appears that you use way too many point masses in them, since you have waves moving up and down through them, every time you move the fixed points. Also, the instability and oscillation you experience is notorious for bodies of interconnected springs. It can be removed by using more damping or less stiffnes, but the best way is to make an iterative solution.


Sorry in advance if I misunderstand you, I don't want to sound harsh or patronizing. :-)


Also, I promised you a code sample which is on its way. Cheers, Mike

In Topic: Rope and sails?

17 January 2016 - 10:06 AM

Two things here:


First thing - As a seasoned sailer (viking ships) I'd like to point out that there is much more to sails than "the wind fills it like a bag and pushes the ship forward". What accellerates the ship is really the sucktion created *in front of* the sail, not the wind caught behind it. Sailships move considerably faster when the wind hits the sail edge-on, at a less-than 90 degree angle to the direction the ship is sailing in, than when the ship moves directly down wind, and the sail is expanded by the wind like a balloon. In other words, a sailship will move much faster at - say - 40 degrees up against the wind than with the wind coming directly from behind!  Programming this is going to be non-trivial.


Second thing - Ropes and sail (cloth) can easily be programmed with point masses and springs. If you implement an iterative method you'll get incredibly stable and rigid materials. I can give you some small, fuctional code samples to work with, but you may have to translate them to your own preferred programming language.


Cheers, Mike

In Topic: 2D circular with elliptical orbit interference

20 December 2015 - 12:04 PM

How deep have you dug into orbital mechanics yet? Do you know how to compute state vectors from orbital elements and vice versa? Do you know how to derive mean, eccentric and true anomalies from each other? You'll need a function that computes the position of each body as a function of time. A simple solution would be to then iterate forward with a time step defined as a fraction of the smallest of the two orbital periods. Rather than checking for direct collision, you could check if the ship enters the planets Hill sphere or sphere of influence, inside which its trajectory could be altered a lot.


Cheers Mike

In Topic: Spaceship course calculation

17 December 2015 - 10:09 AM

I'd still go for a non-physical solution. How about this: define four waypoints that describe the trajectory. Point 1 and 2 are connected with a spline (for the smooth curve), 2 and 3 with a straight line, 3 and 4 with another spline. Compute travel time from trajectory length. Now compute destination position from travel time. Iterate until convergence is reached.