Hi,
I have created an user data slider (with percent unit) to controlling subdivisions number of a spline (spline with an Adaptive interpolation). So I have used a MapRange function to convert a percentage to a degree but this dosen't returnning a natural result. because the number of an intermediate subdivision points is increasing exponentially.
I want to know how to fit an exponential number of intermediate points to a linear.
SplineObject *sp = SplineObject::Alloc(4, SPLINETYPE_BEZIER); // create a spline with 3 verts
Vector *gp = sp->GetPointW();
gp[0] = Vector(0, 0, 0);
gp[1] = Vector(0, 0, 900);
gp[2] = Vector(0, 250, 1200);
gp[3] = Vector(0, 900, 1200);
sp->GetDataInstance()->SetBool(SPLINEOBJECT_CLOSED, false);
Float value = data->GetFloat(BSK_OBJECT_CURVE_SUB);
Float min_input = 0;
Float max_input = 1;
Float min_output = 90;
Float max_output = 1;
Float inrange = max_input - min_input;
if (CompareFloatTolerant(inrange, 0.0)) value = 0.0;
else value = (value - min_input) / inrange;
curve_sub = DegToRad(min_output + (max_output - min_output) * value);
sp->SetParameter(SPLINEOBJECT_ANGLE, curve_sub, DESCFLAGS_SET_0);