Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

98
Views
Ways to make bezier curves with about 8-9 control points in Javascript

I am making a game where i need to display ship traversing a flowing river. I am creating river with bezier curves but it is with only 3 control points from the bezerCurveTo. So, the river is not 'curvy enough.' How can i go about achieving this?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The tabageos.GeometricMath Class has some advanced functions for curves, paths and merging Arrays. To accomplish what you want you could join multiple paths together. For example: https://codepen.io/Contrapenner/pen/mdBVrbw

function dot(x, y) {
    var d = document.createElement("span");
    d.setAttribute("style", "position:absolute;left:" + x + "px;top:" + y + "px;width:2px;height:2px;background: blue");
    document.getElementById("river").appendChild(d);
  };
  var riverPath = tabageos.GeometricMath.getRawArcCurvePath(5, 5, 10, 10, 5, 15, 10);
  riverPath = tabageos.GeometricMath.mergeArrays(riverPath, tabageos.GeometricMath.getRawArcCurvePath(5, 15, 0, 20, 5, 25, 10));
  riverPath = tabageos.GeometricMath.mergeArrays(riverPath, tabageos.GeometricMath.getRawArcCurvePath(5, 25, 10, 30, 5, 35, 10));
  riverPath = tabageos.GeometricMath.mergeArrays(riverPath, tabageos.GeometricMath.getRawArcCurvePath(5, 35, 0, 40, 5, 45, 10));
  //and you could keep going as needed.
  //there is also getRawHermiteCurvePath
  var i = 0;
  for (i; i < riverPath.length; i += 2) {
    dot(riverPath[i], riverPath[i + 1]);
  }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!