Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
bad rotation
#3
(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
Reply


Messages In This Thread
bad rotation - by aloriza - 11-22-2023, 09:51 PM
RE: bad rotation - by _Aka_ - 11-22-2023, 11:45 PM
RE: bad rotation - by aloriza - 11-23-2023, 11:31 AM
RE: bad rotation - by _Aka_ - 11-23-2023, 09:02 PM
RE: bad rotation - by aloriza - 11-29-2023, 09:31 AM
RE: bad rotation - by _Aka_ - 11-29-2023, 09:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Rotation issue with generator nicolaj.h.andersen@gmail.com 1 16 04-14-2023, 11:58 AM
Last Post: _Aka_
Photo Rotation anchors tairoark 4 11 06-01-2022, 02:54 PM
Last Post: _Aka_
  Align to spline action and rotation Lupp_ 3 1,341 01-23-2021, 08:12 PM
Last Post: _Aka_
  Rotation of Curvy Spline Segment jh092 1 1,350 05-31-2020, 09:36 AM
Last Post: _Aka_

Forum Jump: