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
  I have to refresh generator manualy :( GameDeveloperek4123 4 13 10-07-2024, 05:36 PM
Last Post: _Aka_
  Can't set CG Path Controller j95677 4 22 10-04-2024, 06:55 PM
Last Post: j95677
  Bug: Save Generator Outputs still saves outputs if object is disabled curvymesher 1 3 08-30-2024, 09:19 AM
Last Post: _Aka_
  How can I set the generator to stop updating? emerrryjones 1 10 07-26-2024, 10:07 AM
Last Post: _Aka_

Forum Jump: