Vectrosity Question: Weird Line segment

Hello guys

I am new to unity, grabbed the engine last week and made a leaning project using
Unity indie
Vectrosity 1.2
and iTween.
I came from flash background and very surprise by the ease-of-use features of unity engine.

The project is a ship battle game. You can try out the demo here:
http://www.kongregate.com/games/unitynoob/unity-pirate

I encounter a problem with Vectrosity’s line. Please take a look at the screenshot below:
470362--16514--$Wierdline.png
I draw the ship path using

Vector.SetLineParameters (Color(1,0,0), path_material, 4, 2,31, LineType.Continuous, Joins.Fill);
ship_path_line = Vector.MakeLine(  "path_line", path_points);

But if you look closely, apart from the path line(which is intended), there are several very thin lines(quite hard to see) connecting each of the segment join point towards the inside of the curve. How can i get rid of the these lines?

I tried a whole night that I couldn’t figure out what is causing this problem. Please let me know if you know the answer. Thank you in advance!

BTW: I am really new to 3d, so if someone can give me some tips on particles, it will be greatly appriciate :slight_smile: Thank you!

That’s probably related to using Joins.Fill. Try changing that to Joins.None and see if the problem goes away. If so, then you should supply the points right away when making the line, instead of afterward with Vector.MakeLine:

ship_path_line = new VectorLine ("path_line", path_points, Color(1,0,0), path_material, 4, 2, 31, LineType.Continuous, Joins.Fill);

Otherwise, when using Joins.Fill, the line mesh making routine gets confused. I’m not 100% happy with the way Joins.Fill works, but I haven’t found a better way yet.

–Eric

Wow, that was super fast answer, thank you very much Eric!

I will try it out today:)

Hey Eric, is there a way to solve this problem with DrawLine3D? I’m stuck with exactly the same problem, but I need the line to be in 3D.

Yes, there was actually a bug with DrawLine3D + Joins.Fill. It’s fixed in the next version; send me a PM with your email address for the hotfix.

–Eric

Hi Eric,

I just bought the Vectrosity package and have been playing around with it,
I am currently using your DrawLinesTouch.js
When I change the following line of code:
line = new VectorLine(“DrawnLine”, linePoints, lineMaterial, lineWidth, LineType.Continuous);

to:
line = new VectorLine(“DrawnLine”, linePoints, lineMaterial, lineWidth, LineType.Continuous, Joins.Fill);

It gives me a weird extra line from my touch position and the bottom end of the iPad screen ( I think (0,0) coordinate)

I also tried making
linePoints[0] = Vector2.one;
since it was mentioned in another example of yours

Any help is appreciated.

When using Joins.Fill with open lines (as opposed to closed shapes like rectangles or circles), just make sure the first and last points in the array are different somehow before creating the VectorLine object. See “A note about Joins.Fill” on page 28 in the docs…for the next version of the docs, I’ve moved that information into the discussion of Joins.Fill itself, so it should be more clear.

[Edit: later versions have automated this, so you don’t need to do anything now, it will just work.]

–Eric

Hi, I’m trying to draw a circle around the base of my car object using Joins.Weld. However, it’s looking a little wonky around some points. (going into the ground) If I use any other join type it doesn’t distort, but the joins are bad.

Why might this be happening?

Using weld moves the points around to make the welds work, which is less successful when used in 3D, since Vectrosity is currently heavily geared toward rendering the lines facing the camera. You can try using a hack for orienting lines in other ways, such as having a camera pointing straight down toward the car, and using that as the vector camera, so the line will be drawn facing that camera instead.

–Eric

ah ok, using a camera above worked.