Hello,
I have a simple script that generate a Bezier/Vertex path, but i have an unexpected result with normals.
The normals unexpectedly flip 90 deg after appending (AddSegmentToEnd method) the first point to the first segment. After the first flip, when I append other points the normals do not flip anymore.
The first path segment is created automatically when the pathcreator object is created from a "center", as in the original BezierPath.cs constructor.
Below is the script that trigger the addition of the anchor point (apologies for the poor formatting, i can't get the new line working when embedding code).
I also attached three scene screenshots:
path before appending the first point, as created by the constructor (it is a straight segment, as i changed controlHeight to 0)
path after appending the first point, which shows the unwanted flip of the normals
how i would like to have it (no flip); i simply forced to 0 the global normals angle parameter in the inspector
I would really appreciate any hint of what could be wrong, because i'm really puzzled about this.
Hello, I have a simple script that generate a Bezier/Vertex path, but i have an unexpected result with normals. The normals unexpectedly flip 90 deg after appending (AddSegmentToEnd method) the first point to the first segment. After the first flip, when I append other points the normals do not flip anymore.
The first path segment is created automatically when the pathcreator object is created from a "center", as in the original BezierPath.cs constructor.
Below is the script that trigger the addition of the anchor point (apologies for the poor formatting, i can't get the new line working when embedding code). I also attached three scene screenshots:
how i would like to have it (no flip); i simply forced to 0 the global normals angle parameter in the inspector
I would really appreciate any hint of what could be wrong, because i'm really puzzled about this.
public PathCreator pathCreator; ... Vector3 offset = Vector3.right + Vector3.forward * 0.5f; newPoint = lastAnchor + offset.normalized * segmentLenght; pathCreator.bezierPath.AddSegmentToEnd(newPoint);