Vectrosity update released

Vectrosity 1.5 is now up on the Asset Store! If you don’t already know, this is a utility for all sorts of line-drawing in Unity. Whether you need an equivalent of Debug.DrawRay that works in builds (not just the editor), or want to make complex graphs, or anything else that involves lines: selection boxes, paths, freehand drawing, and so on, this is for you. Lines can be drawn as a 2D overlay, or 3D lines can be drawn in the scene itself, and they can be solid-colored or textured. In addition to lines, you can draw points, too (see this web demo, which is entirely drawn with Vectrosity, except for the spheres–note that when you switch to full-screen, the stars are still pixel-perfect). There are many functions that allow you to quickly make ellipses, curves, splines, rectangles, even simple vector text. A single line can have any number of different colors and line widths. Works on anything that will run Unity apps, including older iOS devices. Includes documentation that is “second to none” (thanks, hippocoder :slight_smile: ), and lots of examples. And a complete game project.

–Eric

Very cool tool kit! keep it up :slight_smile:

Looks great Eric5h5… can’t wait to get my upgrade.

Very cool and some of the stuff looks like something I was just recently looking for on the runtime side :smile:

thumbs up to Eric

Hi Eric,

I’ve bought Vectrosity over your website. Will you send out updates by mail?

Yes, I’m setting up a system for updates, but if you don’t want to wait, send me a PM with the email address you used when buying Vectrosity, and I’ll send out the update to that address right away.

–Eric

Is the TankZone complete project still included?

Yep.

–Eric

Is there a changelog?

i have purchased old version, will i get the new one free?

Yes, click on the version number in the Asset Store. You can also see it here.

Yes, if you bought it on the Asset Store, click “download” in the download manager when there’s a new version. If you bought it on my site, you can either wait for me to finish the update system, or send me a PM with the email address you used when buying, and I’ll send the upgrade.

–Eric

Everyone constantly on a regular basis asks if its a free upgrade, I’m sure poor eric has it on cut and paste now :slight_smile: great release though, loving it.

Great work Eric. Another quality tool :slight_smile:

Just a note that 1.4.2 is out. It’s a pretty minor update this time:

Vectrosity 1.4.2

Changes:
• The default material that’s used when passing in null for a line material works with transparency better.
• Vector.MakeTextInLine can use a Vector3 for the start position (for lines using Vector3 points).

Fixes:
• Joins.Weld works with DrawLine3D properly.
• MakeTextInLine works if it’s used with an array that has the exact number number of points necessary for the text (which would happen if MakeTextInLine was called twice on the same VectorLine with the same text, for example).

–Eric

what is this …mean vectorline?
**

[quote]**
var linematerial : Material;
var texturescale = 4.0;
private var selectionline : Vectorline;
private var originalpos : Vector2;
function start () {
**selectionline = new vectorline(“selection”, new vector2[5], color.white, linematerial, 4.0, linetype.continuous); **
}
function ongui () {
gui.label(rect(10, 10, 300, 25), “click drag to make a selection box”);
}
function update () {
if (input.getmousebuttondown(0)) {
originalpos = input.mouseposition;
}
if (input.getmousebutton(0)) {
vector.makerectinline (selectionline, originalpos, input.mouseposition);
vector.drawline (selectionline);
}
vector.settexturescale (selectionline, texturescale, -time.time*2.0 % 1);
}
**[/quote]
**

Hi Eric, and thanks for the great update!

Just started to use your utility and would like to know, how the line/point width should behave when resolution is changed.
Lets say the resolution is halved, then the scene lines and points are scaled (by resolution) nicely. After updating line, the
line width / point size is “resized” to something not related to screen size change.

Should I keep the correct width/size ratio by my self with some own scaling factor or is there easier way to do it?

TIA,
Juha

VectorLine is the type of object used in Vectrosity to define lines.

–Eric

You should call Vector.SetCamera after any resolution change, and then redraw any existing lines, so that line width is set correctly.

–Eric

Thanks for fast reply!

The “Vector.SetCamera3D()” does not seem to scale the width correctly…

Screenshots are from low-res and high-res screens. The “u” has
been pressed to update the view… As seen, the form of line is correct, but the line/point size are not scaled…

Any ideas, what might be wrong?

using UnityEngine;

public class TestVisualization : MonoBehaviour
{

    public VectorLine line;
    VectorPoints vecPoints;

    public int segments = 250;
    Vector3[] points;

    public Material lineMaterial;
    public Material pointMaterial;

    float pointSize = 10f;
    float lineWidth = 5f;

    void Start()
    {

        points = new Vector3[4];
        points[0] = new Vector3(-2,-2f);
        points[1] = new Vector3(0f, 1.5f);
        points[2] = new Vector3(1f, 0.2f);
        points[3] = new Vector3(2f, 2.2f);

        line = new VectorLine("Spline", new Vector3[segments + 1], lineMaterial, lineWidth, LineType.Continuous);
        Vector.MakeSplineInLine(line, points);
        Vector.DrawLine3D(line);

        vecPoints = new VectorPoints("Points", points, pointMaterial, pointSize);
        Vector.DrawPoints3D(vecPoints);
    }

    void Update()
    {
        if (Input.GetKeyDown("u"))
        {

            Vector.SetCamera3D();

            Vector.MakeSplineInLine(line, points);
            Vector.DrawLine3D(line);

            vecPoints.Resize(points);
            Vector.DrawPoints3D(vecPoints);
        }
    }

}

BR,
Juha

644608--23048--$vec1.PNG

Actually, what I said about SetCamera only applies to SetCamera and 2D lines, and not SetCamera3D. 3D lines only need to be re-drawn after a resolution change; SetCamera3D doesn’t need to be called again. In any case, line width is based on pixels, so if you want the line to keep the same relative thickness after a resolution change, then you’d need to use a different pixel width. So basically I misunderstood your original question, and in this case yes you’d want to apply some kind of scaling factor to the width on your own.

–Eric