Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Vectrosity - fast and easy line drawing

Discussion in 'Assets and Asset Store' started by Eric5h5, May 26, 2010.

Thread Status:
Not open for further replies.
  1. coolpowers

    coolpowers

    Joined:
    Mar 23, 2010
    Posts:
    125
    Anyone been able to get Vectrosity working with WP8 builds? I'm using the source package, not the DLL, but I'm getting this at startup:

    {System.MissingMethodException: Method not found: 'Void Vectrosity.VectorLine..ctor()'.
    at Asteroid.Unity_Deserialize()
    at lambda_method(Closure , Object , Object[] , Int32 )}

    The demo scenes (in UnityScript) work just fine, so it seems to be an issue with my use of C#
     
    Last edited: Aug 19, 2013
  2. coolpowers

    coolpowers

    Joined:
    Mar 23, 2010
    Posts:
    125
    Okay, so this is really, really weird. After trying all kinds of things, what finally worked was.. making the VectorLine members I had in a couple of classes private instead of public.
     
  3. tamberlain

    tamberlain

    Joined:
    Jun 16, 2013
    Posts:
    20
    What is the best way to keep vector text facing the camera? I notice that when I draw 3d text and then move the camera, the text stays in the same plane as the original direction the camera was facing and never changes the direction of that plane relative to the camera, even when I'm moving the text around with a transform via Draw(transform).

    I'm drawing text numbers that match to a 3D position in space as per my previously mentioned example script: https://dl.dropboxusercontent.com/u/11025048/horizon.cs (Except I now draw the lines using "Draw(transform)" and not Draw3DAuto(transform), and I now have a loop in Update that runs Draw(transform) again on every line to keep them all updated as the camera moves).

    The text items are basically arranged on a sphere that is around the camera. The sphere is always aligned to Vector.zero, so when the camera moves within it the numbers appear to move around the camera (they are essentially compass lines, or horizon lines and the text is the degree angles written next to each mark). Having to call MakeText on each vector text object every Update seems like it would be one way to update the text direction as the camera moves.

    But I can't work out how to apply the transform that keeps the text in its relative position around the camera and then apply another transform just to rotate each little text item to face the camera.

    Thanks!
     
    Last edited: Aug 20, 2013
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    MakeText was primarily intended for 2D drawing, so it just creates text in the x/y plane. You could "bake" a particular rotation into the 3D text by making a matrix and using it with MultiplyPoint3x4 on all the points, as seen in the VisibilityControlStatic script. Basically, after using MakeText,

    Code (csharp):
    1. var thisMatrix = someTransform.localToWorldMatrix;
    2. for (var i = 0; i < myLine.points3.Length; i++) {
    3.     myLine.points3[i] = thisMatrix.MultiplyPoint3x4(myLine.points3[i]);
    4. }
    (Making sure the transform is at the origin, otherwise the position would get applied as well.)

    --Eric
     
  5. nerik

    nerik

    Joined:
    Nov 8, 2011
    Posts:
    22
    Hi there !

    First thanks for that really handy extension. I hope I'm not asking something too obvious.

    I'm using Vectrosity for a small drawing widget on a mobile app. So I started using the DrawLinesTouch example. It looks fine when using Joins.Weld but I find these joins look odd when drawing.

    But Joins.Fill looks broken, as if half of the triangles were not rendered (see screencap).

    $VECTROSITY_BUG.jpg

    I should also specify that I get the same result with a textureless material.

    I guess it has something to do with calling line.Draw() repeatedly but I'm not sure how to fix that exactly.

    Thanks for your help.
     
  6. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    Looks like there's an issue with .minDrawIndex and Joins.Fill; for now you can just remove this line in the script: "line.minDrawIndex = lineIndex-1;".

    --Eric
     
  7. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    So my fix for the "triangle connecting to origin" problem wasn't thought through very well...now it's really fixed in the next version so it doesn't cause additional problems like that....

    --Eric
     
  8. tamberlain

    tamberlain

    Joined:
    Jun 16, 2013
    Posts:
    20
    You gave me the idea I needed to solve it, thanks! I don't understand MultiplyPoint3x4 yet, but I got the idea from what you suggested. Here is how I did it, in case it's useful to other people.

    During the Start() phase where I'm drawing the vector text on the imaginary sphere around the camera, I use a rotate-Vector3-around-Vector3 on every point in the array of points3 on the vector text line. After that I just need to call a Draw() on the text vector lines to keep them updated on screen as the Camera and the imaginary sphere move relative to each other. So the only heavy point translation is when the vector text lines are first drawn.

    Code (csharp):
    1.  
    2.  
    3. //TO DRAW VECTOR TEXT IN 3D SPACE AND MAKE IT APPEAR TO FACE THE CAMERA
    4.  
    5. //Initialise temporary transform and rotation points
    6. Vector3 tmpPos;
    7. Transform someTransform;
    8. someTransform = new GameObject().transform;
    9.  
    10. //Position of text in 3d space away from camera. Set textStartPosition to whatever Vector3
    11. //represents where you want the text to appear in space
    12. tmpPos = textStartPosition;
    13.  
    14. //Move our temporary transform to the same location as the text.
    15. someTransform.position = tmpPos;
    16.  
    17. //Make the temp transform look AWAY from the camera.
    18. someTransform.LookAt(2 * someTransform.position - Camera.mainCamera.transform.position);
    19.  
    20. //Create the vector text as usual in 3d space. To start with it is aligned with the X-Y plane, NOT facing the camera as you might expect.
    21. VectorLine text = new VectorLine("CompassLineText", new Vector3[2], lcol, null, lineWidth, LineType.Discrete);
    22. text.MakeText("SampleText", tmpPos , 2f);
    23.            
    24. //Loop through all the points3 in the vector text line.
    25. //We then rotate each point to the desired angle based on the rotation of our temp transform so it will appear to face the camera.
    26. for (var j = 0; j < text.points3.Length; j++) {
    27.     //To rotate a Vector3 around another Vector3 pivot point:
    28.     //rotation:Quarternion * (pointToRotate:Vector3 - rotationPoint:Vector3) + rotationPoint:Vector3
    29.     text.points3[j] = someTransform.rotation * ( text.points3[j] - tmpPos) + tmpPos;
    30. }
    31.  
    32. //Draw the vector text as usual.
    33. //This Draw call will also need to be done once per vectorline in Update()
    34. //You can put an additional transform as the first property inside the Draw() call to keep text
    35. //positioned relative to camera how you want it.
    36. text.Draw();
    37.  
    38.  
     
  9. nerik

    nerik

    Joined:
    Nov 8, 2011
    Posts:
    22
    Thanks Eric for the reply, it works.

    Another quick one : as mentioned in the doc, the geometry created "sticks around" whatever happens. Is there a way to reproduce that behaviour when using SetCameraRenderTexture ? By default it seems to only draw the current line object.

    Of course I can keep an array of lines and loop over them to render them to the texture, but that seems a bit unnecessary...

    Thanks !
     
  10. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    Once you call SetCameraRenderTexture, all lines drawn will show up in the rendertexture (unless you stop it by passing in null to SetCameraRenderTexture).

    --Eric
     
  11. Hexagon-Neuron

    Hexagon-Neuron

    Joined:
    Oct 1, 2010
    Posts:
    305
    Hi Eric5h5,

    I'm loving Vectrosity, and all is going well. However at the moment I get a flicker on some of the vector lines when I move the camera. Sometimes when I stop moving them camera, the line is completely missing. Also it always seems to be the same lines on the object that behave like this.

    I've tried all sorts to get round it, such as different cameras (but that shows all the lines as I need the back face hidden). Any ideas?

    Code here:
    Code (csharp):
    1.  
    2. function Start () {
    3.     aMesh = GetComponent(MeshFilter).mesh;
    4.     var vectorName = transform.name + " (Vector)";
    5.     line = new VectorLine(vectorName, new Vector3[2], lineMaterial, vectorWidth, LineType.Discrete);
    6.     line.SetColor (lineColor);
    7.     line.MakeWireframe (aMesh);
    8.  
    9.     line.Draw3DAuto (transform);
    10. }
    11.  
    One other quick question: Is it possible to place vector lines created inside a child to keep things tidy in the Hierarchy?

    Thanks!
     
    Last edited: Aug 24, 2013
  12. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    I don't get any flickering with your code; possibly you need to use SetCamera with an appropriate camera depending on your setup. As for parenting, you could do line.vectorObject.transform.parent = parentTransform.

    --Eric
     
  13. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,095
    Finally jumped on the Vectrosity bandwagon. This is some serious next level S*** right here. I was not expecting it to be so thorough. Really nice work.

    The only things I'm having to write myself is something to automatically generate a cube with more control. Like being able to also specify the rotation of the cube, or just straight in pass a Bounds and have it generate a cube off of that.

    Also how can I do just a simple MakeLine command that doesn't create a new VectorLine but rather updates an already existing one? I want to update a single line every frame.

    Also how many lines can I be updating ever frame on an iPad 2?
     
    Last edited: Aug 24, 2013
  14. glebski

    glebski

    Joined:
    Nov 21, 2009
    Posts:
    367
    Hi Eric

    Is it possible to use Bresenham's Line algorithm to draw lines, so the stairstepping is "correct"? Likewise using the Circle algorithm to draw circles. I am going for the pixelated look, rather than a smooth antialiased one.

    Thanks
     
  15. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    MakeLine returns a VectorLine object, so you can update the .points2 or .points3 array of that VectorLine and call .Draw() on that line every frame.

    I don't really know, sorry. It would depend on how many line segments are in each line.

    Vectrosity doesn't use bitmaps at all, so I think the only way to do that is to use rendertextures.

    --Eric
     
  16. glebski

    glebski

    Joined:
    Nov 21, 2009
    Posts:
    367
    Thanks Eric

    What about setting each line segment to represent correct stair stepping, instead of bitmaps? So using the same algorithm but instead of pixels, setting Vectrosity points? Just wondering if it would be possible to use Vectrosity for my needs, or to use something else.
     
  17. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    I guess that would work, though maybe you'd rather use TextureDrawLine.

    --Eric
     
  18. Hexagon-Neuron

    Hexagon-Neuron

    Joined:
    Oct 1, 2010
    Posts:
    305
    Thanks for looking at it Eric5h5. I'm going to investigate it again today. Not sure if this will help, but I have grabbed some footage of the problem:


    Also if I disable the Mesh Renderer (It is using Unity Default Diffuse Material) or if set the camera to show just the vector lines layer, there is no flicker/glitching.
     
    Last edited: Aug 24, 2013
  19. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    That's a case where the object mesh and the line mesh are being drawn in the same place; you could scale down the object mesh slightly, or make the lines thicker.

    --Eric
     
  20. Hexagon-Neuron

    Hexagon-Neuron

    Joined:
    Oct 1, 2010
    Posts:
    305
    I've tried making the lines bigger but the same problem exists. If I change the mesh size, will Vectrosity not also change size to match it resulting in the same problem?
     
  21. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    Not if you change the mesh size after using MakeWireframe.

    --Eric
     
  22. glebski

    glebski

    Joined:
    Nov 21, 2009
    Posts:
    367
    I'm going to try and give it a go with dots. But I'm unclear on how to set a single dot position.
    I have a code that is currently instantiating prefabs, and I want to try and use it to draw dots instead.
    Any ideas how? Thanks

    I have managed to do it. But whether the prefabs appeared under the curser. The dots appear in the bottom left hand corner of the screen. How do I make them appear under the cursor? Thanks... again.

    Code (csharp):
    1. import Vectrosity;
    2.  
    3. private var startPoint : Vector3;
    4. private var endPoint : Vector3;
    5. public var startPos : Vector3;
    6. public var endPos : Vector3;
    7. public var newPos : Vector3;
    8.  
    9. function Update() {
    10.     startPos = Camera.main.ScreenToWorldPoint(startPoint);
    11.     endPos = Camera.main.ScreenToWorldPoint(endPoint);
    12.  
    13.     if (Input.GetMouseButtonDown(0)) {
    14.                 startPoint = Input.mousePosition;
    15.                 startPoint.z = 0.0f;
    16.     }
    17.     if (Input.GetMouseButton(0)) {
    18.                 endPoint = Input.mousePosition;
    19.                 endPoint.z = 0.0f;
    20.     drawLine(startPos.x,startPos.y,endPos.x,endPos.y);
    21.     }
    22. }
    23.        
    24.  function drawLine(x0:int, y0:int, x1:int, y1:int)
    25.  { 
    26.     dx= Mathf.Abs(x1-x0);
    27.     dy= Mathf.Abs(y1-y0);
    28.     if (x0 < x1) {sx=1;}else{sx=-1;}
    29.     if (y0 < y1) {sy=1;}else{sy=-1;}
    30.     err=dx-dy;
    31.     loop = true;
    32.    
    33.     while (loop) {
    34.          var test = new VectorPoints("Test", [Vector2(x0, y0)], null, 2);
    35.          if ((x0 == x1)  (y0 == y1)) loop=false;
    36.          e2 = 2*err;
    37.          if (e2 > -dy) {
    38.            err = err - dy;
    39.            x0 = x0 + sx;
    40.          }
    41.          if (e2 <  dx) {
    42.            err = err + dx;
    43.            y0 = y0 + sy;
    44.         }
    45.     }
    46.     test.Draw();
    47. }
     
    Last edited: Aug 24, 2013
  23. Hexagon-Neuron

    Hexagon-Neuron

    Joined:
    Oct 1, 2010
    Posts:
    305
    Billiant! That kind of fixed it. Thanks once again Eric5h5.

    Out of curiosity, while is it happening in the first place? I ask as the drawback with this method is that when getting close to the object you can see that there is a difference in positions between the the mesh edge and the actual vectors.
     
    Last edited: Aug 24, 2013
  24. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    Have a look at the DrawLinesMouse demo script. Also, you should create one VectorPoints object and manipulate the array data as needed, rather than creating many VectorPoints objects with just one array entry each.

    The lines in the mesh are always drawn so they are facing the camera, and if they are right on the surface of another mesh, then depending on the angle, part of the line mesh could be obscured by the other mesh. It's possible you might be able to do something with a shader rather than shrinking the object a bit.

    --Eric
     
  25. Hexagon-Neuron

    Hexagon-Neuron

    Joined:
    Oct 1, 2010
    Posts:
    305
    Last edited: Aug 25, 2013
  26. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    Yes, if they line always rendered on top then you'd lose the backface culling effect, so it would have to be something more complicated. I don't really know enough about shaders to know what might be best for this particular case though.

    --Eric
     
  27. Hexagon-Neuron

    Hexagon-Neuron

    Joined:
    Oct 1, 2010
    Posts:
    305
    Thanks for clarifying Eric5h5, that gives me a good starting point.
     
  28. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,095
  29. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    It currently uses MarkDynamic, but someone in another topic was talking about how it reduced performance. I just took the docs at face value, so I was planning on doing some proper testing to see what really happens to performance when MarkDynamic is used.

    There's no performance benefit for useMeshQuads, but it reduces memory usage a little. (Well, creating VectorLine objects is a bit faster, but not updating.) However, useMeshLines has distinct performance benefits, so it should be used if your lines are 1 pixel thick.

    --Eric
     
  30. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,095
    You know I just realized I don't even know how to turn on useMeshLines, I just read about it in your documentation.

    But going
    Vectrosity.VectorLine.useMeshLines = true;

    gives this error
    `Vectrosity.VectorLine' does not contain a definition for `useMeshLines'

    Where is this parameter?
     
  31. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    It's in the VectorLine class, as described in the docs. It will only work in Unity 4 or higher. If you get an error about not containing a definition, then you're using an old version of Unity or an old version of Vectrosity.

    --Eric
     
  32. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    423
    I am an asset store subscriber to your Vectorisity product and i would like some help in finding a way improve the highlight around the cubes i create in my game. The following image shows the issue in that the lines don't always appear depending on the angle of the camera or the rotation angle of the cube with respect to the camera view.

    $highlightcube.png

    The culprit code causing this affect are the following

    I'm using your VectorLineGlow (just renamed in my resource folder) with the Particles Additive (Soft) shader.

    _s_lineMat = Resources.Load("Materials/GlowBig") as Material;
    _s_line = new VectorLine("wireframe", new Vector3[dupedEdges.Length * 2], lineMat, lineThickness);
    _s_line.Draw3D();

    Things ive tried...

    I have tried using different shaders in the particles range and the unlit shaders. Although they do give different affects the root cause
    seems to be with the way vectrosity creates a mesh based line in 3D. I'm guess that the normals or something are only visible at
    certain viewport angles with the camera, or is it because the line is flat and not a cube style of line?

    Do you have any ideas how to fix this issue with your product?
     
  33. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    Actually this was just discussed; look farther up this page (starting with this post).

    --Eric
     
  34. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    423
    This is an interesting problem. I've checked the previous discussion and this is what i'm experiencing.

    1) If i create VectorLine and use Draw3D or Draw3DAuto and Disable my Cube Mesh Renderer the problem still exists. When i rotate the object, certain angles and camera views cause the lines to become faint or dotted or simply disappear.

    2) However, I have a fix but its very expensive computationally and really more of an unoptimised workaround. Is to simply recreate the vectorline and call Draw3D on every update frame when rotating. This stops this symptom from happening but really too process intensive to be used properly.

    Eric i do really like Vectrosity, and i know there is usually an answer remedy for this. I do however believe it needs fixing s many games will not like this symptom. I believe that work arounds are ok for some things but this has a root issue to be fixed.
     
  35. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    The problem actually can't exist if you've disabled the cube mesh renderer, so I suspect you have something else going on. Take a look at the "Simple3DObject" demo scene...the lines are always rendered correctly if you move the camera around while the scene is playing. There's really never a reason to recreate the VectorLine in this case; it won't accomplish anything that simply re-drawing the line won't do. I'd recommend looking at the demos and seeing how they use Vectrosity, and make sure you're using it the same way.

    --Eric
     
  36. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    423
    It can easily exist because i'm not using Wireframe which uses the mesh object. I have a 3D editing package which provides me with the Vector3 points that i require. Notice i don't display the triangle lines which wireframe displays.

    Thats what i thought the concept of point3 was for to enable people to place or edit their own points when needed.

    The cube mesh is disabled and the VectorLine is used with perimeter edge points to display what looks like a wireframe. Yet the rotations and camera angles cause this symptom with your application.

    I'm just looking for a fix on this as one of your many faithful subscribers to this marvelous package.
     
  37. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    423
    To clarify here is the screen shot what is happening when i rotate it in to certain position which causes issues.

    The first image is when the lines are created with Draw3D or Draw3DAuto, The second image shows what happens when the cube is rotated.

    Note that Draw3D and Draw3DAuto have been tried both causing same issue.

    $LineSymtom.png

    And here is the inspector for the cube lines

    $InspectorLineIssue.png
     
  38. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    Please have another look at the Simple3DObject scene. MakeWireframe is not used, and there are no triangles, only squares.

    Correct, that's what the lines in Simple3DObject are using.

    It looks to me like you're making the VectorLine mesh the child of the cube? Vectrosity really can't be used that way; it interferes with the line drawing routines. Again, I strongly recommend looking at the examples to see the correct usage. Also see the Q&A section, specifically page 48 under "I’m using VectorLine.vectorObject, and it’s messing up the lines" question.

    --Eric
     
  39. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    423
    The study of Simple3DObject did solve my problems. Thank you for persisting with my lack of understanding of how to set this feature up. I now have well behaved 3D lines around my cube object.
     
  40. Redbeef

    Redbeef

    Joined:
    Apr 9, 2013
    Posts:
    2
    Just bought Vectrosity, I'm new to Unity3D, and the component is easy enough to understand!
    I have a very specific goal of drawing some 3D bezier curves, but the 2 curve examples seem to be limited to Vector2 positions. Is there an example for creating 3D curves, or is it just a simple change to the existing demos?
    Thanks in advance for your help.
     
  41. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    3D bezier curves are basically the same as 2D curves, you just need to use Vector3 points instead of Vector2. Otherwise they are used in exactly the same way. (Keeping in mind that Vector2 points use screen space coordinates, and Vector3 points use world space coordinates.)

    --Eric
     
  42. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    423
    When i set my points3 its seems like VectorLine expects the origin to be (0,0,0). How do ensure that the pivot point of the created line object is central to the object enabling me to rotate it.

    Would i have to reparent the line object to a new pivot object and ensure that Draw3D(transform.parent) was set?
     
  43. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    You wouldn't want to parent the line object to anything, since that tends to mess up line drawing. This code makes a 3D curve, and puts an object approximately in the center of it:

    Code (csharp):
    1. import Vectrosity;
    2.  
    3. var tr : Transform;
    4.  
    5. function Start () {
    6.     tr.position = Vector3(5, 1, 10);
    7.     var curvePoints = [Vector3(0, 0, 5), Vector3(0, 2, 5), Vector3(10, 1, 14), Vector3(10, -3, 15)];
    8.     var linePoints = new Vector3[100];
    9.     line = new VectorLine("Curve", linePoints, null, 2.0, LineType.Continuous);
    10.     line.MakeCurve (curvePoints);
    11.     for (p in linePoints) p -= tr.position;
    12.     line.Draw3DAuto (tr);
    13. }
    When you rotate the transform, the curve rotates around that transform as the origin. You could programmatically determine the center of the curve by getting the bounds, and put the transform at bounds.center (I just sort of pulled those numbers out of the air to make some kind of curve).

    --Eric
     
  44. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    By the way, Vectrosity is currently 50% off on my site, until September 2 (along with all the other utilities).

    --Eric
     
  45. Shukerullah

    Shukerullah

    Joined:
    Mar 15, 2013
    Posts:
    95
    that is awesome!
     
  46. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,095
    I have Vectrosity 2.3, newest off the asset store and unity 4.2.0f4

    My build target is set to iOS, is the function ifdef'ed out for iOS?


    On another note, If your still developing this and open to new features to be added. I thought up something that would be really useful to me in your plugin. That being able to draw singular sprites within a VectorLine object. Sort of like the ability to specific a texture for the endcap and have it draw it at the end of the line. But more control, so that you could specify multiple textures to be used for sprites, and you could specify which index they should be drawn at. So then you could do something like draw a cube that has little sphere sprites in each of it's corners, all through the same VectorLine object and DrawCall.
     
  47. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,225
    No, the only conditional compilation is for Unity 3 vs. Unity 4. Since you can't have conditional compilation in DLLs, there are two of them, one for Unity 3, which wouldn't have useMeshLines, so maybe you're using that?

    That's a pretty good idea; I'll see if I can come up with a good way of doing that.

    --Eric
     
  48. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,095
    Yes that would be it, didn't realize I had to open the vectrosity unity4 .package package. Thank you.
     
  49. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    423
    I'm having optimization issues using VectorLine. Basically i have cubes instanced in the scene each having a vectorline object being used to draw lines on the surface edges. I can't seem to see why the dynamic batching is not working given that each vectorline is using a uniform scale (1,1,1) and that every vectorline using same material/texture.

    Any ideas what could be causing this.

    I thought of creating one huge line and indexing into it but this won't work for me since i need rotations on each of my cubes and i would not be able to assign a vectorline with indexing into each cube this way.

    What i have seen is that vectorline basically creates a meshfilter so what could be causing a draw call for each vectorline?
     
  50. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    423
    I noticed that some of the methods in the latest DLL and source are different (downloaded off asset store recently). Anyone found this issue? I think its the methods on VectorLine which differ i recall.
     
Thread Status:
Not open for further replies.
unityunity