- Home /
[Vectrosity] 3d bezier curve not generated correctly
Hello,
I'm trying to draw a 3D bezier curve with Vectrosity (in order to create a 3D selection arrow). If the curve is aligned with the Y-axis, then the result looks as expected (red curve), but any other alignment makes the segments of the curve visible and also introduces some glitches at the start and the end (black curve). Any idea why is this happening?
// Black curve (bad).
VectorLine vl = new VectorLine(
"vl0",
new List<Vector3>() { Vector3.zero, Vector3.zero },
30.0f);
vl.lineType = LineType.Continuous;
vl.Resize( 111 );
vl.MakeCurve(
Vector3.zero,
new Vector3( .0f, .0f, -1.0f ),
new Vector3( -3.0f, .0f, .0f ),
new Vector3( -3.0f, .0f, -1.0f ),
110 );
vl.Draw3D();
vl.color = Color.black;
// Red curve (good!).
vl = new VectorLine(
"vl1",
new List<Vector3>() { Vector3.zero, Vector3.zero },
30.0f);
vl.lineType = LineType.Continuous;
vl.Resize( 111 );
vl.MakeCurve(
Vector3.zero,
new Vector3( .0f, .0f, -1.0f ),
new Vector3( .0f, 3.0f, .0f ),
new Vector3( .0f, 3.0f, -1.0f ),
110 );
vl.Draw3D();
vl.color = Color.red;
Answer by Eric5h5 · Dec 03, 2016 at 07:57 AM
The curve is correct, it's just that you have the line width so wide it's not possible for Vectrosity to draw it as intended. A more usable width of 4 shows the curve correctly, as seen in this screenshot. If you're trying to draw a 3D shape with perspective, Vectrosity isn't really the right tool; it's intended for vector lines with a consistent width.