geometry - Ship movement algorithm -
let's have rectangular sea. it's quite large - 10000x20000.
we have islands, well. simplicity's sake, let's assume rectangular well. know exact places (coordinates).
if have ship, somewhere on map - (x1, y1), how can find shortest path point on map (x2, y2) without going on of islands?
update: there no constraints far - ship or sea. if can simplify (and speed up) things adding few - more welcome.
the path doesn't have best - can 10% off example - acceptable.
- aproximate islands' borders 2d poligons
- connect vertexes of separated poligons (and start , finish points) edges (they must not cross islands)
- apply a* resulting graph
such graph less 10000x20000 grid , let find more realistic paths in better time
update: if islands not big can move ship in direction of finish point , bypass islands on left or right border
Comments
Post a Comment