Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Discrepancy in interpolation Generator vs Controller ?
#1
Hi all,

Today I've encountered an (I think) interesting problem.
I've been trying to get a Curvy Generator and Controller 
to work together but so far I have failed.

What I need is the following:
I have a Generator with a shape extrusion. To Control how far along the spline the
extrusion goes I'm using the .To value of the BuildShapeExtrusion component of the Generator.
leading the 'trail' is a spline controller that is being moved by setting it's .RelativePosition value.
My propblem now is that it seems that the method used to interpolate these two entities is not the same,
for instance when I set the .To to .3f, I have to set the .RelativePosition to .2675f to visually match the two
objects (see image below).
[Image: e378e6f0cb.jpg]

I hope someone can point me in the right direction as to solving this conundrum.

Thanks in advance!

Thijs
if(!isCoding)
    StartCoding();
Reply
#2
Yeah, I can bring some light in Wink

The difference is that the SplineController's "RelativePosition" is actually TF, while the other Controllers (Path,Volume) as well as the Generator uses % due to the fact that a path inside CG don't need to come neccessarily from a spline.

I agree that this might be confusing, but my dilemma was that CurvySpline use TF allover the place (so did the old controllers), that's why I decided to leave it as is with the SplineController.

Perhaps we can add a mode to the SplineController to set position by % as well. Until that you can inherit a custom controller from SplineController and set the RelativePosition by percentage (using spline's length and Spline.DistanceToTF / TFToDistance).
Reply
#3
I see, that makes sense.

I've got it working now. used: 
Code:
controller.RelativePosition = Spline.DistanceToTF(Spline.Length * value);
where value is a 0-1 float.

I think it would be nice to have a mode for using % values for the controllers. Also I think
it might not be clear to everyone (it wasn't to me) that TF and % are in fact not the same.

Since we're on the subject, what does TF stand for?

Thanks again for the quick response Jake!

Thijs
if(!isCoding)
    StartCoding();
Reply
#4
F = Fragment (used for each segment)
TF = Total Fragment (used over whole spline)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Batch processing of the Generator to create a bunch of Meshes HatraE 3 117 10-21-2020, 11:21 AM
Last Post: _Aka_
  Frequent runtime updates of Curvy Generator for simulating plant growth using Splines h4ck3rd4wg 6 409 10-02-2020, 07:57 PM
Last Post: _Aka_
  Error: Calling TeleportBy on a controller that is stopped jamesunity 5 848 07-13-2020, 12:28 PM
Last Post: _Aka_
  Null reference when spline controller added runtime jh092 1 518 06-19-2020, 09:21 AM
Last Post: _Aka_

Forum Jump: