Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
InfiniteTrack example: generated meshes orientations not aligned
#7
When the control points have changed as the track advances, nextControlPointInitalUp needs to adjust for when the currentOrientationAnchor up vectors are non-zero.  Because we want to preserve the up vectors through the parallel transport through the segments.  If we change the code to something like:

Code:
Vector3 nextControlPointInitialUp;
if (currentOrientationAnchor.ApproximationUp[0].sqrMagnitude == 0f)
{  
    nextControlPointInitialUp = currentOrientation.getOrthoUp0Internal();
}
else
{
    nextControlPointInitialUp = currentOrientationAnchor.ApproximationUp[0];
}

That should in theory give us the same up vectors for the old segments and produce the proper up vectors for the new segments.

But we also need to modify the code that does the swirl.  I don't understand what the smoothingAngleStep calculation does, but I suspect that and the block of code below "Apply swirl" which is updating the update vectors needs a fix.  If I comment out the swirl code the meshes are basically aligned though there is a very tiny misalignment.

For now I'll see if I can get away with using Static orientations, the behavior is much simpler and looking at the code probably runs faster too.
Reply


Messages In This Thread
RE: InfiniteTrack example: generated meshes orientations not aligned - by geekrelief - 01-17-2019, 08:36 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Adjust radius of generated mesh via script? Shackman 1 4 03-26-2024, 01:12 PM
Last Post: _Aka_
  Cant Generate Meshes At Runtime alms94 5 22 01-26-2024, 11:27 AM
Last Post: _Aka_
  Get spline from generated mesh beartrox 1 5 11-27-2023, 12:30 PM
Last Post: _Aka_
  Making "gaps" in the generated spline mesh VoltDriver 6 24 11-22-2023, 11:34 PM
Last Post: _Aka_

Forum Jump: