- Home /
Vectrosity line smoothing issue.
Hi, I am using Vectrosity for drawing and I have some unexpected behaviour when try to draw symmetric smooth line. I have 5 points - two exteme points (center of 2 spheres), two "neighbors" of extreme points and middle point. I want to draw something like this:
![alt text][1]
I created 5 points, and array with 4 width values.
When I draw line without smoothing, all is ok: But when I enabled smoothing (line.smoothWidth), line began to draw wrong: (2 - middle point is ok, 1 point is ok, 3 point - wrong). Please see the picture:
![alt text][2]
I am sure that all point positions are correctly (I created sphere object in this points and all looks like on picture without smoothing - I mean that all poins on their place).
Here is my code:
//create line
VectorLine line = new VectorLine("Line", new Vector3[]
{
new Vector3(0, 0, 0), //first exteme point
new Vector3(0, 0, 0), //segment near first exteme point
new Vector3(0, 0, 0), //middle point
new Vector3(0, 0, 0), //segment near second exteme point
new Vector3(0, 0, 0) //second exteme point
},
Color.black,
null,
getLineMaxDynamicsWidth(),
LineType.Continuous);
.........................
...Update point positions...
.......................
//update width
float width = 40;
var widths = new float[] { width , width/2f, width/2f, width};
Vector.SetWidths(line, widths);
line.smoothWidth = true;
Vector.Active(line, true);
Vector.DrawLine3D(line);
I am using Vectrosity 1.4.2.
Can you please help me with this issue? [1]: /storage/temp/8350-whatiwanttodraw.png [2]: /storage/temp/8352-vectrositywithandwithoutsmoothing.png
Answer by Eric5h5 · Feb 27, 2013 at 10:50 PM
Lines are smoothed from one point to the next, so it should do what you want if you add another point.
I am not sure that I understand your answer. Where I should add point?
I want to get symmetric line and use next points and widths for this:
1point----(width)----2point-----(width/2)----3point(middle)----(width/2)----4point----(width)----5point
Your answer
Follow this Question
Related Questions
Multiplayer: jitter caused by camera? by smoothing? 2 Answers
Disable terrain smoothing 0 Answers
Rigidbody 2d smooth movement problem (It's jerky) 1 Answer
Create 'Tippex' for a drawn line. 1 Answer
Different views for graph plotting 0 Answers