Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Create splines at runtime: correct initialization
#3
(10-29-2019, 03:16 PM)_Aka_ Wrote: Hi,
The correct way to add control points to a spline is by using the methods from the CurvySpline class, such as Add, InserrBefore, etc...
Is my answer clear?
Have a nice day
Thanks, solved my problem.

Code:
gameObject.AddComponent<CurvySpline>();
CurvySpline c = gameObject.GetComponent<CurvySpline>();
c.Interpolation = CurvyInterpolation.Bezier;
c.Add(new Vector3(0.0f,0.0f,0.0f));
c.Add(new Vector3(0.0f, 0.0f, 156.0f));
c.Add(new Vector3(100.0f, 0.0f, 256.0f));
c.Add(new Vector3(200.0f, 0.0f, 156.0f));
c.Add(new Vector3(100.0f, 0.0f, 56.0f));
c.Add(new Vector3(0.0f, 0.0f, 156.0f));
c.Add(new Vector3(0.0f, 0.0f, 256.0f));

c[1].AutoHandles = false;
c[1].HandleIn = new Vector3(0.014761f, 0.0f, -54.69138f);
c[1].HandleOut = new Vector3(-0.014761f, 0.0f, 54.69138f);

c[5].AutoHandles = false;
c[5].HandleIn = new Vector3(0.62f, 0.0f, -57.872f);
c[5].HandleOut = new Vector3(-0.62f, 0.0f, 57.872f);
Reply


Messages In This Thread
RE: Create splines at runtime: correct initialization - by Josenildo - 10-30-2019, 02:07 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  New User Looking for Advice on Choosing Curvy Splines ravigupta 1 197 08-21-2026, 09:45 PM
Last Post: _Aka_
  Connections Between Opposing Splines lockiidraws 1 935 12-04-2025, 02:14 PM
Last Post: _Aka_
  Create Game Object Renaming Options rickgplus 1 1,237 09-23-2025, 09:33 AM
Last Post: _Aka_
  Spawn at start/ end of splines rickgplus 4 3,434 03-21-2025, 12:34 PM
Last Post: _Aka_

Forum Jump: