FeBrex
07-10-2009, 11:25 AM
Hi All,
I am trying to implement 3ds max' tcb and bezier interpolation algorithms in my own engine.
Because I do not have access to the 3ds max debug sdk I am just gessing how the actual algorithm works.
This is how I am computing the bezier curve in maxscript. But the values do not match with the values computed by 3ds max.
struct BezierCurve (
a, b, c, d,
fn eval t = (
return t * (t * (t * a + b) + c) + d
)
)
fn getCurve startKey endKey = (
local p0 = startKey.value
local p1 = p0 + startKey.outTangent
local p3 = endKey.value
local p2 = p3 + endKey.inTangent
curve = BezierCurve a:(-p0+3.0*(p1-p2)+p3) b:(3.0*(p0-2.0*p1+p2)) c:(3.0*(p1-p0)) d:p0
return curve
)Can anyone with access to ADN tell me what I am doing wrong? The algorithms are stored in <MaxDebugRoot>\Core\TCBINTRP.CPP and <MaxDebugRoot>\Core\INTRP.CPP
I am trying to implement 3ds max' tcb and bezier interpolation algorithms in my own engine.
Because I do not have access to the 3ds max debug sdk I am just gessing how the actual algorithm works.
This is how I am computing the bezier curve in maxscript. But the values do not match with the values computed by 3ds max.
struct BezierCurve (
a, b, c, d,
fn eval t = (
return t * (t * (t * a + b) + c) + d
)
)
fn getCurve startKey endKey = (
local p0 = startKey.value
local p1 = p0 + startKey.outTangent
local p3 = endKey.value
local p2 = p3 + endKey.inTangent
curve = BezierCurve a:(-p0+3.0*(p1-p2)+p3) b:(3.0*(p0-2.0*p1+p2)) c:(3.0*(p1-p0)) d:p0
return curve
)Can anyone with access to ADN tell me what I am doing wrong? The algorithms are stored in <MaxDebugRoot>\Core\TCBINTRP.CPP and <MaxDebugRoot>\Core\INTRP.CPP
