Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Generator Shape Extrusion Range/Lenght precision
#1
Hello Smile, i have a little issue for a while now, it was'nt bothering me since now.

It's about the Range / lenght settings in the Generator. I change it from an editor tools and I want to set the value depending of 2 Custom SplineController on the spline.

Here I have a part of my raceTrack here:
[Image: IGjmw35PIAa_gen2.PNG]

And the green shape you see is a special Generator, who draw a rectangle in the road, at an given emplacement, with a range of 0.9511405, and a lenght of 0,04026

I have 2 customControllers, here: (they are basicly the same calculation as your CurvyControllers
[Image: IGjmDz7SrRa_gen3.PNG]

[Image: IGjmzzaBJOa_gen4.PNG]

As you see in the first image, the first customController has the variable percentInSpline at 0.9511405, exactly the value in the generator, and I calculate myself the Range.

it seems to work when I am close to 0, but here is another exemple (same calculation), with a mesh who are in the middle of the spline:
[Image: IGjmOBLGBKa_gen5.PNG]



I am sure you are using percentage for the Range & Lenght. So i have tryed to use distance, and then convert it with Spline.DistanceToTF, but the result is then the same.

Mmm ok , I solved it.
Here the convertion CurvySpline.DistanceToTF doesn't worked, so I used my own calculation:

Instead of doing this: StartMesh = GreenController[0].GetPercent()
I do this: StartMesh = GreenController[0].GetDistance() * 1f / lenghtSpine;

and it worked. Cool !

I suggest you to add in the curvyGenerator a way to choose between distance and percent or something like that.

Thanks you x)
Reply
#2
Hi,

Thanks for the details and suggestion.

So I can understand you fully:
  •  Can you tell me please what is the implementation of the GetPercent() and GetDistance() methods?
  •  When you spaek about percent, that word can be interpreted as either a TF*, or a normalized distance (distance/spline's length). What is the meaning you associate to the word percent?
In Curvy Generator, the notion of TF does not exist anymore after the spline rasterization step. What is used in the CG's modules' parameters is the normalized distance.

*More about the difference between TF and distance here: https://curvyeditor.com/documentation/sp...tart#units

Thanks again
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
My Percent is your equivalent of your TF. So TF is relative to the lenght of the Segments in the spline, so it's not what I wanted.
So for my CustomSplineController I use only Distance, with is good for me, and when I need it, I can convert it to TF with Spline.DistanceToTF.

But what I needed for that one is more something like Spline.DistanceToNormalize().

Thanks you, the probleme is solved, and I understand more and more your base code as I progress Wink
Reply
#4
(07-10-2019, 07:10 AM)UsernameHed Wrote: So TF is relative to the lenght of the Segments in the spline.
Not really. If you have 4 segments in your spline, the TF at the start of the 2nd segment is always 0.25, whatever the length of the spline's segments are.
That was just a small clarification, it doesn't change the pertinence of your solution
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Change Shape Extrusion of Generator by code UsernameHed 5 341 Yesterday, 03:14 PM
Last Post: _Aka_
Information [Quick and dirty] Shape Extrusion: interpolate between multiple Crosses _Aka_ 9 2,607 09-02-2019, 09:42 PM
Last Post: _Aka_
  New version Broke my Generator after each compilation UsernameHed 3 112 08-23-2019, 02:20 PM
Last Post: _Aka_
  Same Spline Extrusion with variable width MarioBag 3 418 06-27-2019, 12:41 PM
Last Post: _Aka_

Forum Jump: