Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

99
Vistas
Formas de hacer curvas bezier con aproximadamente 8-9 puntos de control en Javascript

Estoy creando un juego en el que necesito mostrar un barco que atraviesa un río que fluye. Estoy creando un río con curvas bezier, pero solo tiene 3 puntos de control desde bezerCurveTo . Entonces, el río no es 'lo suficientemente curvo'. ¿Cómo puedo hacer para lograr esto?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

La clase tabageos.GeometricMath tiene algunas funciones avanzadas para curvas, caminos y matrices de fusión. Para lograr lo que desea, puede unir varios caminos. Por ejemplo: 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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda