Tessellation of FBXNurbsCurve is incorrect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm using FBX SDK version 2020.3.4 Release to convert the FBXNurbsCurve to FBXLine.
Here's the definition of my FBXNurbsCurve, given that I have defined pScene as FbxScene:
FbxNurbsCurve* lNurbs = FbxNurbsCurve::Create(pScene, "nurbscurve");
lNurbs->SetOrder(3);
lNurbs->Color.Set(FbxDouble3(1, 0, 0));
// Control points
static FbxVector4 lControlPoints[5] = {
{ -4.0, -4.0, 0.0, 1.0},
{ -2.0, 4.0, 0.0, 1.0},
{ 2.0, -4.0, 0.0, 1.0},
{ 6.0, 4.0, 0.0, 1.0},
{ 8.0, -4.0, 0.0, 1.0},
};
lNurbs->InitControlPoints(5, FbxNurbsCurve::eOpen);
int count = lNurbs->GetKnotCount();
double lUKnotVector[] = { 0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.74, 0.865};
memcpy(lNurbs->GetKnotVector(), lUKnotVector, count * sizeof(double));
FbxVector4* lVector4 = lNurbs->GetControlPoints();
memcpy((void*)lVector4, (void*)lControlPoints, 5 * sizeof(FbxVector4));
Once this lNurbs is well defined, I want to evaluate the points on that curve with the TessellateCurve API:
FbxLine* tessellated_line = lNurbs->TessellateCurve(16); // Steps = 16
The points of the tessellated_line is incorrect (see the attached files).
Has anyone encountered this issue before, or am I missing something obvious?
Thanks for any help with this issue.