Search Unity

Vectrosity - Fast and Easy Line Drawing

Discussion in 'Assets and Asset Store' started by Eric5h5, Sep 26, 2014.

  1. dacoursey

    dacoursey

    Joined:
    Dec 17, 2016
    Posts:
    31
    Hi Eric, wondering if maybe you see something easy I'm missing in the coordinates with line creation. I am creating lines like a master now, but I want to instantiate a prefab on my line, to later follow as a path. When I instantiate, the prefab is nowhere to be seen, but if I use (0,0,0) it's in the center of the screen.


    Code (CSharp):
    1. GameObject mover = Instantiate(Thomas, (Vector3)squiggle.points2[0], Quaternion.identity);
    2. SpriteRenderer sr = mover.GetComponent<SpriteRenderer>();
    3. sr.sortingLayerName = "Train";
    I have tried ScreenToWorldPoint() and WorldToScreenPoint() and it still doesn't work.

    Thanks for looking!

    David
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    Vector2 points are screen coords, and need to be converted to world coords. You need to use ScreenToWorldPoint correctly. There are various topics where you can get more information if you do a forum search.

    --Eric
     
  3. flairzguru

    flairzguru

    Joined:
    Jan 29, 2017
    Posts:
    6
    Hi Eric,
    Currently I am using Grid Points system for drawing these lines. Its a 5x5 grid and I am providing world space co-ordinates of these points which is very simple task.How many points do I need to achieve smoothness ? But I think it will just increase complexity of drawing lines.Does there exist any other solution to achieve the same ?
     
  4. PsyDev

    PsyDev

    Joined:
    Sep 30, 2015
    Posts:
    31
    Hi Eric,

    I just purchased Vectrosity and have it pretty much working. I'm using it to draw 3D lines with Draw3DAuto. I basically just pasted the Orbit sample code into my project. However, I am getting lots of jitter in the lines when I move the camera. The lines jump around. Any idea what could be causing that? Is it possible there is an execution order problem here, where the LineManager is getting updated before the camera positions?

    Any help would be appreciated.

    Here is the code for reference:

    Code (CSharp):
    1.     void Start()
    2.     {
    3.         orbitLine = new VectorLine("OrbitLine", new List<Vector3>(numOrbitLinePoints), 2.0f, LineType.Continuous);
    4.         orbitLine.material = orbitPathMaterial;
    5.         orbitLine.texture = orbitPathMaterial.mainTexture;
    6.         // x position is the radius of the orbit
    7.         orbitLine.MakeCircle(Vector3.zero, Vector3.up, transform.localPosition.x);
    8.         orbitLine.Draw3DAuto();
    9.     }
    10.  
     
  5. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    Probably you're using large coordinates, which won't work well due to floating-point limitations. Keep all transforms <10K units from the origin.

    --Eric
     
  6. klskl

    klskl

    Joined:
    Apr 2, 2016
    Posts:
    1
    I have two lines, one straight line, let's call it "platformLine" and one Ellipse line, we call that "circleLine".

    I want CircleLine to fall down until it collides with platformLine, then it should stop.

    What I have:

    Code (CSharp):
    1.  void Start() {
    2.          VectorLine.SetCanvasCamera(Camera.main);
    3.          platformPoints = new List<Vector3>(new Vector3[2] { new Vector3(-10, 0), new Vector3(10,0) });
    4.          platformLine = new VectorLine("platformLine", platformPoints, 5.0f, LineType.Continuous);
    5.          platformLine.collider = true;
    6.          platformLine.Draw();
    7.          circleLine = new VectorLine("circleLine", new List<Vector3>(10), 5.0f, LineType.Continuous);
    8.          circleLine.MakeEllipse(new Vector3(0, 10), .4f, .4f);
    9.          circleLine.collider = true;
    10.          // give the circle a rigidbody, so that it falls down
    11.          circleLine.rectTransform.gameObject.AddComponent<Rigidbody2D>();
    12.          circleLine.Draw();
    13. }
    So I have two lines with colliders, one of them has a rigidbody, and as I understand it, that's all that is needed to detect collision, and for my circle to be stopped.

    What else is needed?
     
  7. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    It's not really possible to have line colliders interact like that. There are a number of problems: for one, trying to "trick" Vectrosity into using world coords with Draw won't work, since the colliders are specifically created by converting screen coords to world coords. So using world coords with Draw in the first place makes the colliders not be created anywhere close to the correct place. If using world coords, use Draw3D rather than Draw.

    Another issue is that edge colliders don't collide with other edge colliders. You can have polygon colliders instead by using LineType.Discrete instead of Continuous, and polygon colliders do collide with edge colliders.

    However, directly manipulating a line's Transform generally prevents Vectrosity from working correctly, which is why that practice is discouraged in the docs. Adding a Rigidbody2D component causes Unity to directly manipulate the line's Transform, hence this can never work: by following the practices above, the colliders will actually interact fine, but the drawing for the circle line will be totally whack (a highly precise technical term ;) ). Line colliders are generally meant as static colliders against which regular objects can collide.

    So objects that collide with VectorLines should not be VectorLines themselves. You can still use Vectrosity as essentially a renderer for another object by using VectorLine.drawTransform, though; this way you could have dynamic objects with colliders that are drawn with Vectrosity.

    --Eric
     
  8. PsyDev

    PsyDev

    Joined:
    Sep 30, 2015
    Posts:
    31
    Thanks for the tip. The near clipping plane was very small (0.01), so bumped that up to 0.03 and it works fine now. [EDIT] That should say bumped up to 0.3, an order of magnitude difference.
     
    Last edited: Mar 20, 2017
  9. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    I didn't consider zbuffer precision; good to know.

    --Eric
     
  10. Maxii

    Maxii

    Joined:
    May 28, 2012
    Posts:
    45
    Eric,

    I've been using your great product for years. Just saw something for the first time:

    Thought you should know:

    Screen position out of view frustum (screen pos 4674343936.000000, 90209394688.000000, 0.000000) (Camera rect 0 0 973 471)
    UnityEngine.Camera:ScreenToWorldPoint(Vector3)
    Vectrosity.VectorLine:Draw3D()
    Vectrosity.LineManager:LateUpdate()
     
  11. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    Thank you, but I would need to know what code/version/circumstances were causing that before I can address it.

    --Eric
     
  12. Razmot

    Razmot

    Joined:
    Apr 27, 2013
    Posts:
    267
    Headsup, in unity 5.5.2p2 and p3 vectrosity wont work :

    Code (CSharp):
    1. Can't add a 'RectTransform' to the "New Game Object" game object during Awake when a 'Transform' is already attached.
    2. You probably need to add a 'RectTransform' to the "New Game Object" game object in the editor.
    3. (Filename:  Line: 179)
    4.  
    5. NullReferenceException: Object reference not set to an instance of an object
    6.  at Vectrosity.VectorLine.SetupTransform (UnityEngine.RectTransform rectTransform) [0x00000] in <filename unknown>:0
    7.  at Vectrosity.VectorLine.SetupLine (System.String lineName, UnityEngine.Texture texture, Single width, LineType lineType, Joins joins, Boolean use2D) [0x00000] in <filename unknown>:0
    8.  at Vectrosity.VectorLine..ctor (System.String name, System.Collections.Generic.List`1 points, Single width, LineType lineType) [0x00000] in <filename unknown>:0
    This is something to check in the next unity versions, the api to create gameobjects with a recttransform in awake may need to be changed.

    More details here:
    https://forum.unity3d.com/threads/i...n-the-gameobject-is-inactive-at-first.461123/

    and here

    http://digitalnativestudios.com/forum/index.php?topic=1479.msg10999#msg10999
     
  13. Maxii

    Maxii

    Joined:
    May 28, 2012
    Posts:
    45
    Unity 5.5.1f1
    Vectrosity 5.3
    No circumstances I can note as it was one time and came out of the blue.
    I am using very large distances though, as far away as 50K units from the origin
     
  14. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    Good to know, thanks; I haven't checked it with 5.6 in a while but it worked with it at the time.

    That's probably the issue, then; in general you should stay <10K units from the origin.

    --Eric
     
  15. Tivec

    Tivec

    Joined:
    Jun 20, 2015
    Posts:
    12
    Hello! Just want to say thank you for an awesome product, I use Vectrosity a lot in my current project, and it is working great.

    I was wondering how I could get my hand on the GameObject the mesh for a 3d line lives on, though. I spawn lines via code, and it creates new gameobjects for every set of lines I want to use.

    I've tried using the line.rectTransform or line.drawTransform, but to no avail. I just want to parent the object to another transform, to keep my hierarchy free of clutter :) Thoughts?
     
  16. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    line.rectTransform.gameObject

    --Eric
     
  17. Tivec

    Tivec

    Joined:
    Jun 20, 2015
    Posts:
    12
    Hm, I was doing just that earlier, and it didn't want to parent itself to the object I was giving it.

    Code (CSharp):
    1. _line.rectTransform.gameObject.transform.SetParent(transform);
    (I suppose I can drop the gameObject out and use rectTransform.transform, should be the same iirc).

    I still get the lines as unparented in the hierarchy. It's not a big deal, but it gets messy when you use them lots.
     
  18. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    Using VectorLine.rectTransform.SetParent does successfully parent any line to whatever transform you specify. (Note that this practice is discouraged since directly manipulating VectorLine transforms generally breaks Vectrosity. However, using an empty GameObject at the origin as the parent wouldn't cause any problems.)

    --Eric
     
  19. dacoursey

    dacoursey

    Joined:
    Dec 17, 2016
    Posts:
    31
    Hi Eric, while banging my head on the js->c# translation of the splinefollow2d demo I realized a couple things.

    1. You're using the strict sense of 'spline' so it has fewer points.
    2. I need to stay oriented towards my next point so that the car stays on the road, per se.

    Any chance you could kick me in the right direction?

    Code (CSharp):
    1. while (moving)
    2. {
    3.     for (float dist = 0.0f; dist < 1.0f; dist += Time.deltaTime * .05f)
    4.     {
    5.         Vector2 splinePoint = squiggle.GetPoint01(dist);
    6.         mover.transform.position = Camera.main.ScreenToWorldPoint(new Vector3(splinePoint.x, splinePoint.y, 10.0f));
    7.     }
    8. }
    Thanks
    David
     
  20. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    Not quite sure what you mean by #1, but for #2, probably use Transform.LookAt with the next point in the line.

    --Eric
     
  21. Tivec

    Tivec

    Joined:
    Jun 20, 2015
    Posts:
    12
    Yeah, I understand that it can break them. No matter how I try though, I can't get it to be parented. Here, the "Chunks" object should have the grids as children. "Chunks" is at 0,0,0, and I use _line.rectTransform.SetParent(transform.parent) (each chunk is their own object just under Chunks). Still no go.

    http://i.imgur.com/2LD1DJF.png

    Are there any other options to organize 3D lines?
     
  22. flairzguru

    flairzguru

    Joined:
    Jan 29, 2017
    Posts:
    6
    Hi Eric,
    I am making a spline with some X no of control points (max is 25) and collider enabled.I want to move a ball within this spline but at some points colliders are not welding properly so ball is not able to move through it. How can I fix that ?

    Here is my sample code

    Code (CSharp):
    1. vectorLine = new VectorLine ("MyLine", new List<Vector3> (1000 + 1), lineTexture, lineWidth, LineType.Continuous, Joins.Weld);
    2. vectorLine.collider = true;
    3. splinePoints.Add (cellPos); //X No of points
    4. vectorLine.MakeSpline (splinePoints.ToArray ());
    5. vectorLine.Draw3D ();
    SplineColliderIssue.png
     
  23. dacoursey

    dacoursey

    Joined:
    Dec 17, 2016
    Posts:
    31
    Eric, for #1 I just meant that it wasn't a direct translation for the code. Will the GetPoint01(dist) still work if I have a couple hundred densely-packed points?
     
  24. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    What's your code doing exactly?

    Unfortunately what you're attempting is somewhat beyond what Vectrosity was intended for. I'd say you're looking at more of a road/path tool than a line-drawing tool. The colliders are actually welding properly given the way lines are constructed, so the colliders you want won't be possible to generate with Vectrosity, and will need to be custom generated some other way.

    It should; it uses doubles rather than singles when adding the distance between each point for greater accuracy.

    --Eric
     
  25. Tivec

    Tivec

    Joined:
    Jun 20, 2015
    Posts:
    12

    Here's the code snippet for where I generate the line:
    https://gist.github.com/3d536aef947a771377938dd21db9288a
     
  26. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    OK, you're trying to use SetParent before the line is drawn.

    --Eric
     
  27. Tivec

    Tivec

    Joined:
    Jun 20, 2015
    Posts:
    12
    Oh, that makes sense! Thank you very much, got it working right :) Again, thanks for a great product!
     
  28. UnityRocksAlt

    UnityRocksAlt

    Joined:
    Dec 28, 2015
    Posts:
    137
    Hello Eric,

    I bought your asset a year ago, now I wish to use it for tank tread trails as the tank moves in a 2D plane. Can I use Vectrosity to produce lines with tire/ground texture continuosly and it will not suffer in draw calls?

    Imagine having 50 of these at once.
     
  29. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    If you have 50 VectorLines then there would be 50 draw calls. You can have many "separate" lines in a single VectorLine if you use LineType.Discrete, but for something like you describe that would be more complicated than it's worth.

    --Eric
     
  30. UnityRocksAlt

    UnityRocksAlt

    Joined:
    Dec 28, 2015
    Posts:
    137
    Thanks, I will let you know when I use them.

    Thanks
     
  31. dacoursey

    dacoursey

    Joined:
    Dec 17, 2016
    Posts:
    31
    Eric, I am just not getting the canvas/layering thing. I am creating a new canvas, assigning my VectorLine and my sprite to the same sorting layer, and I have set the proper order values. But when I debug, the objects show their layers as "Default / 0".

    What the heck am I missing?

    Code (CSharp):
    1. void Start ()
    2. {
    3.  
    4.     DrawingCanvas.sortingLayerName = "Track";
    5.  
    6.     squiggle = new VectorLine("Track", new List<Vector2>(), tracks, 40f, LineType.Continuous);
    7.     squiggle.textureScale = 1.0f;
    8.     squiggle.SetCanvas(DrawingCanvas, false);
    9.  
    10.     mover = Instantiate(Car, new Vector3(100, 100, 0), Quaternion.identity);
    11.     mover.name = "mover";
    12. }
    13.  
    14. void Update ()
    15. {
    16.     if (Input.GetMouseButton(0))
    17.     {
    18.         if (clear)
    19.         {
    20.             clearPath();
    21.         }
    22.        
    23.         clear = false;
    24.         curPosition = Input.mousePosition;
    25.         Vector3 travel = curPosition - oldPosition;
    26.  
    27.         if (travel.magnitude > 4)
    28.         {
    29.             squiggle.points2.Add(curPosition);
    30.         }
    31.  
    32.         oldPosition = curPosition;
    33.     }
    34.  
    35.     if (Input.GetMouseButtonUp(0))
    36.     {
    37.         squiggle.points2.Add(squiggle.points2[0]);
    38.  
    39.         Vector3 trackStart = Camera.main.ScreenToWorldPoint(squiggle.points2[0]);
    40.         trackStart.z = 0;
    41.         mover.transform.position = trackStart;
    42.  
    43.         StartCoroutine("moveTracker");
    44.     }
    45.  
    46.     squiggle.Draw();
    47.     Debug.Log("Line Layer: " + squiggle.layer);
    48.     Debug.Log("Canvas Layer: " + DrawingCanvas.sortingLayerName);
    49. }
     
  32. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    GameObject layers and sorting layers are entirely different and unrelated things. But if you're setting layer stuff on a canvas, you wouldn't set it for the items on the canvas anyway.

    --Eric
     
  33. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    453
    Hi Eric, just updated to 5.6 and noticed some obsolete warnings in the console. Are you considering releasing a version for 5.6, also hopefully with the above fix included? I've made the fix in the source version already, but just wanted to confirm for the dll. Thanks.
     
  34. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    Yes; actually I've fixed those a couple days ago.

    --Eric
     
    Korindian likes this.
  35. dacoursey

    dacoursey

    Joined:
    Dec 17, 2016
    Posts:
    31
    I get that, but I am not able to get *anything* to go over the top of my VectorLine canvas, whether I create it or use the default. In all of your posts you say the canvas should be "Screen Space - Overlay" but according to the Unity docs that puts it in the UI layer on top of everything. Has something changed recently that would alter the behavior you expect to see?
     
  36. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    Normally the canvas should be screen space overlay, but if you want to sort it with other stuff, then it should be screen space camera. If you just want to sort it with other canvases, leave it as screen space overlay and change the sorting order of the canvas.

    --Eric
     
  37. whizzkid

    whizzkid

    Joined:
    Nov 2, 2016
    Posts:
    7
    I'm trying to draw a route on a map in 3d. but the lines don't get smaller the further away they get from the camera.

    Now I know vectrosity isnt compatible in World space.. But isn't it possible to allow (At least) 2d drawing on a canvas in world space? if you render it as if the camera is facing the canvas, then you'd solve problems like the one I'm having here :)

    upload_2017-4-6_15-48-32.png

    so it would look like this (in editor screenshot)

    upload_2017-4-6_15-55-32.png
     
  38. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    Correct, that's the idea of Vectrosity, that the lines are fixed-width vector lines. For your case I'd suggest using the LineRenderer component instead.

    --Eric
     
  39. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    Vectrosity 5.4 is out (on my site; has been submitted to the asset store)! Changelog:

    Changes:
    • Unity 5.4 is the minimum required version.
    • Fully compatible with Unity 5.6.
    • The DLL location is moved from Plugins/Vectrosity to Vectrosity/Plugins. If upgrading from an older version, delete the Plugins/Vectrosity folder first.
    • VectorLine.SetCanvasCamera (camera, id) overload is removed, since it doesn't do anything considering VectorLine.canvases was removed a while ago. VectorLine.SetCanvasCamera (canvas) still exists of course.
    • Added worldPositionStays parameter to VectorLine.SetMask, which is useful when using a canvas with screen space - camera (set it to false in this case).

    Fixes:
    • Fixed case where using VectorLine.SetDistances could potentially result in an out of range error.
    • Fixed error that would occur when VectorLine.smoothWidth = true but no line widths were set.
    • Custom material behavior is consistent when using Draw3D.
    • LineMaker and VectorLine2D editors work correctly on retina displays.

    Aside from Unity 5.4 being the minimum, I removed the Unity 4 packages since hardly anyone's using that anymore. But if you do need Vectrosity for earlier Unity versions, send me a PM with the invoice number you got when purchasing.

    --Eric
     
  40. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    ...And is now on the store; record time for approval I think.

    --Eric
     
    Korindian likes this.
  41. wxxhrt

    wxxhrt

    Joined:
    Mar 18, 2014
    Posts:
    139
    Hi Eric,

    I'm getting this error -

    Code (CSharp):
    1. Enabling or adding a Renderer during rendering; this is not allowed. Renderer 'Shape' will not be added.
    2. UnityEngine.GameObject:AddComponent()
    3. Vectrosity.VectorObject3D:SetVectorLine(VectorLine, Texture, Material, Boolean)
    4. Vectrosity.VectorLine:SetupCanvasState(CanvasState)
    5. Vectrosity.VectorLine:Draw3D()
    6. Vectrosity.VectorManager:DrawArrayLine2(Int32)
    7. Vectrosity.VisibilityControl:OnBecameVisible()
    8.  
    using this (old) code

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using Vectrosity;
    5.  
    6. public class scriptVectrosity : MonoBehaviour {
    7.  
    8.     public TextAsset lineData;
    9.     public Texture lineTex;
    10.     public float lineThickness;
    11.     public bool onlyWireframe;
    12.     List<Vector3> linePoints;// = new List<Vector3>();
    13.     public float vectorMultiplier;
    14.  
    15.     void Start () {
    16.         linePoints =  VectorLine.BytesToVector3List(lineData.bytes);
    17.         for (int i = 0; i < linePoints.Count; i++){
    18.             linePoints [i] *= vectorMultiplier;
    19.         }
    20.         VectorLine line = new VectorLine("Shape", linePoints, lineTex, lineThickness);
    21.         line.joins = Joins.None;
    22.         VectorManager.useDraw3D = true;
    23.         VectorManager.ObjectSetup(this.transform.gameObject, line, Visibility.Dynamic, Brightness.None, onlyWireframe);
    24.  
    25.     }
    26.  
    27.  
    28.     void Update () {
    29.  
    30.     }
    31. }
    32.  
    This is using Vectrosity 5.4 with Unity 5.6 on a mac. Can you help?
     
  42. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    Sorry, I overlooked that particular case. I've released 5.4.1 now and submitted it to the asset store:

    Vectrosity 5.4.1

    Fixes:
    • ObjectSetup with useDraw3D = true works with Unity 5.6.

    --Eric
     
  43. wxxhrt

    wxxhrt

    Joined:
    Mar 18, 2014
    Posts:
    139
    Thanks for this Eric but is it possible to get a copy of this through email, as it's for a project thats got a tight deadline I'll pm my transaction no.
     
  44. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    302
    Howdy @Eric5h5,

    When I run your 3dSimpleObject demo scene, nothing draws and i get the following errors on all 3 cubes:

    any thoughts on why this is happening?
     
  45. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    Please update to Vectrosity 5.4.1.

    --Eric
     
  46. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    486
    Hi @Eric5h5

    I've just upgraded to 5.4.1 and ended up with following error:
    When I check the object there is a mesh renderer attached to it. The code causing the problem is this:

    Code (CSharp):
    1.             selectionLine.Draw3D ();
    2.             selectionLine.active = false;
    and this

    Code (CSharp):
    1.                 previewLine.Draw3D ();
    2.  
    3.                 previewLine.rectTransform.GetComponent<Renderer> ().material.mainTextureScale = new Vector2 (0.8f, 1);
    I think with the new version, mesh renderer is created/attached differently, causing that problem.

    Any suggestions? Btw, I'm on unity 5.5.3
     
  47. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    Sorry about that; I'd suggest going back to Vectrosity 5.4. The only reason to use 5.4.1 is if you're using Unity 5.6. In any case, I've made a fix for the next version. However even with that fix, your second example still wouldn't work as-is, since the line's Renderer component in Vectrosity 5.4.1 and later doesn't exist until the end of the frame now. So you'd need to make some changes. Thanks, Unity 5.6! :rolleyes:

    --Eric
     
  48. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    486
    Thanks for the info, I went back to 5.4 as you've suggested. I'll deal with it later.
     
  49. ch0kk0

    ch0kk0

    Joined:
    Jan 20, 2016
    Posts:
    36
    Vectrosity 5.4.1, Unity 5.6.0p3
    So i got this version working on Windows Store App/Hololens using Vectrosity source (would not build with the DLL)

    I still had old code there, where I would create a new Vector Line with an empty list of points, then start adding points as user drew freehand, and then i would call Draw3D(). This used to work with previous version of Vectrosity. Now it crashes in VectorObject3d.cs in UpdateMeshAttributes:m_mesh.Clear();

    It also crashes if i create VectorLine with a single start point, then add a finish point via points3.add

    If i provide a pair of points at time of creation, the VectorLine works.

    Is this the way it must be done now ? cheers
     
  50. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,172
    Hi, if Unity is crashing, it would be best to submit a bug report to Unity. I don't think I can do anything about that.

    --Eric