(11-22-2023, 11:45 PM)_Aka_ Wrote: Hi
I see that your spline's orientation is set to Static. You can keep using this setting while setting the right rotation to the control points you create, or you can set the orientation to Dynamic. This way, only the rotation of the control points that are Orientation Anchors matters. More about it here:
https://curvyeditor.com/documentation/splines/curvysplinesegment#orientation_anchor
and here:
https://curvyeditor.com/documentation/splines/curvyspline#orientation
I hope this helped.
Have a nice day
thank for reply
can you explain more?
my problem is bad rotation on my road that between 2 segments there is 180 degree turn(some times)!!!
maybe problem is my mesh generator
void on_start()
{
mGenerators = new CurvyGenerator[1];
for (int i = 0; i < mGenerators.Length; i++)
{
mGenerators[i] = buildGenerator();
mGenerators[i].name = "Generator " + i;
}
for (int i = 0; i < mGenerators.Length; i++)
while (!mGenerators[i].IsInitialized)
yield return 0;
}
CurvyGenerator buildGenerator()
{
// Create the Curvy Generator
CurvyGenerator gen = CurvyGenerator.Create();
gen.AutoRefresh = true;
// Create Modules
InputSplinePath path = gen.AddModule<InputSplinePath>();
InputSplineShape shape = gen.AddModule<InputSplineShape>();
BuildShapeExtrusion extrude = gen.AddModule<BuildShapeExtrusion>();
BuildVolumeMesh vol = gen.AddModule<BuildVolumeMesh>();
CreateMesh msh = gen.AddModule<CreateMesh>();
// Create Links between modules
path.OutputByName["Path"].LinkTo(extrude.InputByName["Path"]);
shape.OutputByName["Shape"].LinkTo(extrude.InputByName["Cross"]);
extrude.OutputByName["Volume"].LinkTo(vol.InputByName["Volume"]);
vol.OutputByName["VMesh"].LinkTo(msh.InputByName["VMesh"]);
// Set module properties
path.Spline = TrackSpline;
path.UseCache = true;
CSRectangle rectShape = shape.SetManagedShape<CSRectangle>();
rectShape.Width = 10;
rectShape.Height = 1;
extrude.Optimize = false;
extrude.CrossHardEdges = true;
vol.Split = false;
vol.SetMaterial(0, road_material);
vol.MaterialSetttings[0].SwapUV = true;
vol.MaterialSetttings[0].KeepAspect = CGKeepAspectMode.ScaleV;
msh.Collider = CGColliderEnum.None;
return gen;
}
some times my road and my spline path are not same