Curves

@mrdoob @alteredq

I just wrote some classes for curve, still thinking/in-the-midst of implementing them in Path.

https://github.com/zz85/three.js/blob/b287fd1d8629af9cd93ff102d0446657cfd9184b/src/extras/geometries/Curve.js

Basically, any line can subclass curve, for right now I have
Straight(Line)Curve, QuadraticBezierCurve, CubicBezierCurve, SplineCurve

Sub classes usually implements

getPoint: function ( t /* between 0 .. 1 */) 

but inherits the common methods

getLength: function () {
getLengths: function (divisions) {
getPoint: function ( t /* between 0 .. 1 */) {
getPointAt: function ( u /* between 0 .. 1 */) {
getPoints: function (divisions) {
getSpacedPoints: function (divisions) {
getUtoTmapping: function (u, distance) {

soon, path.getPointAt(t) would call its curves getPointAt internally..

any thoughts or comments for this?

Author: Fantashit

1 thought on “Curves

Comments are closed.