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
  Manipulate Generator properties in c#? blabz2007 9 530 06-18-2021, 09:17 AM
Last Post: _Aka_
  Accessing generator's input spline in script, changing it at runtime smackledorf 3 285 06-17-2021, 01:59 PM
Last Post: _Aka_
  Questions about Generator: mesh/objects within spline, snap to control point dartboard 5 459 06-09-2021, 12:42 PM
Last Post: _Aka_
  Spot Generator resetting some values after Script compilation Mos Def 11 1,222 05-25-2021, 02:41 PM
Last Post: _Aka_

Forum Jump: