Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Vectrosity - Fast and Easy Line Drawing

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

  1. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    Yes, you can call ObjectSetup on the object again.

    --Eric
     
  2. socoman3

    socoman3

    Joined:
    Jan 31, 2014
    Posts:
    19
    I just tried and found an issue. When calling ObjectSetup again at runtime the lines drawn get a position offset from the object itself. I am using this code:

    ...
    void Start()
    {
    Vector3[] linePoints = {...};

    myLine = new VectorLine("Brick", new List<Vector3>(linePoints), lineThick);
    myLine.color = wireColor;

    VectorManager.ObjectSetup(gameObject, myLine, Visibility.Static, Brightness.None);
    VectorManager.useDraw3D = true;
    }

    void OnCollisionEnter()
    {
    VectorManager.ObjectSetup(gameObject, myLine, Visibility.Dynamic, Brightness.None);
    }
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    Good point; in order to make Visibility.Static work, Vectrosity creates a new unique list of points that are offset by the object's position. You'd want to change the points list back to the original points when changing to Visibility.Dynamic.

    --Eric
     
  4. socoman3

    socoman3

    Joined:
    Jan 31, 2014
    Posts:
    19
    It worked! thanks!!
     
  5. DenisM

    DenisM

    Joined:
    Dec 6, 2013
    Posts:
    62
    Hello. Im using custom material with multiply textures. Seems i cant get proper texture coords for second texture? is it possible with vectrosity?

    Code (CSharp):
    1. struct v2f {
    2.                 fixed4 vertex : SV_POSITION;
    3.                 fixed2 texcoord : TEXCOORD0;
    4.                 fixed2 texcoord1 : TEXCOORD1;
    5.             };
    6.  
    7.  
    8. v2f vert (appdata_t v)
    9.             {
    10.                 v2f o;
    11.                 o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
    12.                 o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
    13.                 o.texcoord1 = TRANSFORM_TEX(v.texcoord1,_LavaTex);
    14.                 return o;
    15.             }
     
  6. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    Vectrosity only uses Mesh.uv, not uv2.

    --Eric
     
  7. Dimitris-Sarmis

    Dimitris-Sarmis

    Joined:
    May 13, 2015
    Posts:
    3
    Hello, Is there a way to hide parts of an already drawn line?
    I have created the red line and i want to hide the parts that are inside the green boxes. (the green boxes do not exists at my project, they are just visual aids )
    lines.jpg
     
  8. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    If that screenshot is all you need, then you can just put rectangles (which have the same color as the background) over the line. If it's more complex, you could try inverse masks...I did a quick search and found this, though I didn't try it.

    --Eric
     
    Dimitris-Sarmis likes this.
  9. dred

    dred

    Joined:
    Apr 8, 2013
    Posts:
    30
    Hello,

    I have a 2 Vector3 points A, B between them i want to create an 3D arc. As i read in docs :

    At the minimum, you need to define the origin, radii, and the start and end degrees.

    so my code is :



    Code (CSharp):
    1. List<Vector3> arcPoints = new List<Vector3>();
    2.            
    3.             for (int i = 0; i < 11; i++)
    4.             {
    5.                 Vector3 arcPoint = Vector3.Lerp(p.vectorPath.Last(), enemy.transform.position, 0.1f * i);
    6.                 arcPoints.Add(arcPoint);
    7.             }
    8.  
    9.             VectorLine arc = new VectorLine("Arc", arcPoints, null, 4f, LineType.Continuous, Joins.Weld);
    10.             arc.color = Color.black;
    11.             arc.MakeArc(p.vectorPath.Last(), 5, 10, 0, 180);
    12.             arc.Draw3D();
    and it's look realy awful. I try some changes in MakeArc arguments, but it's doesn't help. I try to find some examples, but all you'r examples is for 2d and on js, so it's doesn't help at all. Pls help me get a nice 3d arc betwen 2 points. Thanks.
     
  10. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    I'm not sure what the point of your code is where you add some specific points, since they're just going to get overwritten by MakeArc anyway. If you're really just using 11 points, that's probably why it doesn't look good; you'd need a lot more than that for a smooth arc.

    --Eric
     
  11. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    733
    Hi there,

    I am trying to use Vectrosity in the rendering of a boardgame. I am using Draw3D for my lines, and for the most part everything works fine for the actual game. However in order to make it easier to design the various gameboards in the first place, I wanted to draw the lines in the editor, in edit mode. I will paste the short test script at the end of this post, but basically it works fine in game, but in edit mode Vectrosity errors out saying I need at least 1 segment, which is being given.

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. using System.Collections.Generic;
    5. using Vectrosity;
    6.  
    7. [ExecuteInEditMode]
    8. public class RouteEntity : MonoBehaviour
    9. {
    10.     public string name;
    11.     public float width;
    12.     public int pointCount;
    13.     public Color color;
    14.  
    15.     private VectorLine routeLine;
    16.     private List<Vector3> splinePoints;
    17.  
    18.     // Use this for initialization
    19.     void Start ()
    20.     {
    21.  
    22.     }
    23.  
    24.     // Update is called once per frame
    25.     void Update ()
    26.     {
    27.         if (routeLine == null)
    28.         {
    29.             Debug.Log("Creating new line");
    30.             routeLine = new VectorLine(name, new List<Vector3>(pointCount + 1), width, LineType.Continuous);
    31.             splinePoints = new List<Vector3>();
    32.         }
    33.         splinePoints.Clear();
    34.         foreach (Transform child in transform)
    35.         {
    36.             Debug.Log("Adding point for " + child.position);
    37.             splinePoints.Add(child.position);
    38.         }
    39.         routeLine.MakeSpline(splinePoints.ToArray());
    40.         routeLine.Draw3D();
    41.     }
    42. }
    43.  
    44.  
     
  12. SeventeenthShard

    SeventeenthShard

    Joined:
    Jul 13, 2013
    Posts:
    1
    Hello Eric!

    I purchased Vectrosity for use making a game that's similar to Geometry Wars. It is a top-down physics-based 2D vector shapes-blowing-up-things game. My basic design is:
    1. Everything in the game is a 2D vector shape.
    2. These shapes move according to Newtonian mechanics, and may exert forces on each other.
    3. These shapes can collide, either to produce an exchange of momentum or to cause destruction.
    Unfortunately, despite maybe ten hours wrestling with Vectrosity, I cannot figure out how to do this. I need to have game objects that move in world coordinates with colliders that match them visually--2D collision is totally fine, and is in fact preferred.

    I've tried everything I could think of, but nothing seems to work. I made a demonstration that has two triangles with RigidBody2Ds in them and a VectorLine3D--again, I need world coordinates--and while the debugger says that the collider is being created with reasonable values, I do not witness a collision. I've included my code below:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections.Generic;
    3. using Vectrosity;
    4.  
    5. public class TriangleThing : MonoBehaviour {
    6.     private VectorLine vLine;
    7.     public PhysicsMaterial2D triangleMaterial;
    8.  
    9.     // Use this for initialization
    10.  
    11.     public void Start() {
    12.         float scale = 10.0f;
    13.  
    14.         VectorLine vLine =
    15.             new VectorLine ("Triangle",
    16.               new List<Vector3> () {
    17.                 new Vector3 (-2.0f, 0.0f, 0.0f) * scale,
    18.                     new Vector3 (2.0f, 0.0f, 0.0f) * scale,
    19.                     new Vector3 (0.0f, 3f, 0.0f) * scale,
    20.                     new Vector3 (-2.0f, 0.0f, 0.0f) * scale,
    21.                 },
    22.               1.0f,
    23.               LineType.Continuous
    24.             );
    25.         vLine.collider = true;
    26.         vLine.physicsMaterial = triangleMaterial;
    27.  
    28.         VectorManager.ObjectSetup (gameObject, vLine, Visibility.Dynamic, Brightness.None);
    29.     }
    30.    
    31.     // Update is called once per frame
    32.     void Update () {
    33.         //vLine.Draw3D ();
    34.     }
    35.  
    36.     void OnControllerColliderHit(ControllerColliderHit hit) {
    37.         // Log the name object that was hit
    38.         Debug.Log("The object hit was: " + hit.gameObject.name);
    39.  
    40.         // Log the tag of the object that was hit
    41.         Debug.Log("The object hit has the tag: " + hit.gameObject.tag);
    42.     }
    43. }
    I throw that onto a GameObject at the root level of the hierarchy (not under a VectorCanvas) and make another gameobject translated up by 50 in the y direction, with stronger gravity. The top one falls through the bottom one but there is no collision.

    My real question is this: given that I want to do my physics in 3D coordinates, is there a way to use Vectrosity to facilitate this? I don't mind doing some preprocessing of my geometry--I can find the center of mass of a polygon and normalize that to be at 0,0 relative to the GameObject, for instance. I feel like this is a pretty basic thing to want to do, and I've found nothing about this use case in the documentation. Stepping through the debugger has provided me with some insight, but not enough to figure out what I *should* be doing.

    Thanks!
     
  13. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    Vectrosity doesn't currently support 3D lines in the editor, sorry.

    I'm pretty sure edge colliders won't collide with other edge colliders (like in 3D how mesh colliders don't interact). I'd recommend using primitive colliders instead, but you'd have to add them manually rather than using VectorLine.collider = true.

    --Eric
     
  14. Guideborn

    Guideborn

    Joined:
    Jun 15, 2013
    Posts:
    228
    I'll be purchasing Vectrosity tonight; however, I have a question:

    I mainly want to use Vectrosity to apply lines to edges of simple shapes to build a toon-like world; I still want the 3D shape to be visible, I'm not trying to make a 3D vector shape, I simply wish to use the lines on object for visual purposes. Something similar to Manifold Garden. I'm far from a programmer, but upon looking at the Vectrosity documentation, it seems all I would have to use is LineMaker to do this, without having to code. Is that the case? I'm willing to purchase this just for that alone!
     
  15. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    There would be a little bit of code involved in using the shapes you created with LineMaker, but otherwise yes.

    --Eric
     
  16. Guideborn

    Guideborn

    Joined:
    Jun 15, 2013
    Posts:
    228
    Hey, Eric. I'm trying to do the BytesToVector2Array thing to save lines I made with LineMaker. I create my line segments then select Write Complete Line to File to save the .bytes file. In the documentation, it says I'll need a TextAsset variable. Am I writing this code? If so, how exactly do I use the bytes information with this? Sorry that I am not very savvy with all this! Fortunately, this is the only obstacle so far (even though I'm not that far in ;p).
     
  17. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    See the BytesToVector3Array section in the Vectrosity5 Coding document, which has example code. Also some of the demo scripts use this, such as the Simple3D 2 script.

    --Eric
     
  18. Guideborn

    Guideborn

    Joined:
    Jun 15, 2013
    Posts:
    228
    In the Simple3DObject scene, I am basically looking to replicate what the Simple3D 3 script is doing; having whatever vector lines I make with LineMaker parallel with the object LineMaker is used on. However, this script appears to be hard-coded as opposed to just dragging the .bytes file into the script slot. Any advice?

    Also, I want to change the colors of these LineMaker lines using the inspector? However, I'm not able to select any lines in the hierarchy to do so because they do not show up.
     
  19. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    Use the Simple3D 2 script. Use VectorLine.color to change line colors; you wouldn't use the inspector since the lines are created with code.

    --Eric
     
  20. Dimitris-Sarmis

    Dimitris-Sarmis

    Joined:
    May 13, 2015
    Posts:
    3
    Thanks, i was hopping to a simpler solution but it seems i have to use masks. It is much more complex, my problem. There are multiple lines, the background is a dynamic image that i need to show, while hidding the apropriate lines.
     
  21. shihab37

    shihab37

    Joined:
    Jul 7, 2015
    Posts:
    18
    Hello Eric,
    Sorry to bother you again but I think I found the problem.

    I am sometimes changing the color of the line before redrawing. In SetColor(), you are setting m_updateColors flag. Now, if at the time of Draw() the line has zero points3, the CheckPointsCount() clears the mesh but does not update lineVertices or lineColors.
    Then in OnPopulateMesh(),
    Code (CSharp):
    1. m_mesh.colors32 = vectorLine.lineColors;
    this line throws exception
    CapLine Log2.png

    If I update meshVertices as well (by adding m_vectorObject.UpdateVerts(); in SetColors() after line 1330), the problem is solved. But I have no idea if it is even right to do.

    Plus I have noticed that you are increasing the size of lineVertices and lineColors etc when line points are increased but you are not decreasing it when line points are decreased. is that intentional? (if this is a really stupid question, I apologize. I am really new with Unity)
     
  22. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    You're right; I've added a check to make sure the mesh.vertexCount is the same as the colors array.

    Yes, it's how Lists work; Lists are backed by an array which is not resized even if you remove points (to reduce GC churn). I'm basically reimplementing Lists using arrays, since it's faster.

    --Eric
     
  23. shihab37

    shihab37

    Joined:
    Jul 7, 2015
    Posts:
    18
    Thanks man :)
     
  24. ionside

    ionside

    Joined:
    Apr 7, 2011
    Posts:
    43
    Brilliant addon, thank you. I do need a little though. I need to offset the transform of the lines and understand drawTransform is what's needed. But I don't quite understand how to use it. Below is what I currently have. vectorline.drawTransform.position = new Vector3(-60.0f, -20.0f, transform.position.z); is incorrect but wondering how it should be written.

    Code (CSharp):
    1. void Start () {
    2.         var linePoints = new List<Vector3>() { new Vector2(0,0), new Vector2(10,20), new Vector2(20,3), new Vector2(50,0)};
    3.  
    4.         vectorline = new VectorLine("Line", linePoints, 2.0f, LineType.Continuous, Joins.Fill);
    5.         vectorline.SetColor(new Color(1,0.6f,0.0f));
    6.         vectorline.layer = 8;
    7.         vectorline.drawTransform.position = new Vector3(-60.0f, -20.0f, transform.position.z);
    8.         vectorline.Draw3D();
    9.     }
     
    Last edited: Dec 31, 2015
  25. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    You assign a Transform to drawTransform; there is no drawTransform.position.

    --Eric
     
  26. ionside

    ionside

    Joined:
    Apr 7, 2011
    Posts:
    43
    Right, excellent. Thanks, Eric. That was quite silly of me really.
     
  27. Mukabr

    Mukabr

    Joined:
    Jun 10, 2013
    Posts:
    61
    There's any way to get a line by it's name? I mean the name that you've created?

    Code (csharp):
    1.  VectorLine line = new VectorLine ("LineChar"+i.ToString(), points, 2.0f);
    2. //Something like this
    3. VectorLine.GetLine("LineChar0").color = ...
     
  28. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    No, but using strings is usually not a good idea in general, since there's nothing protecting against typos in the string. You can keep the reference to the line when you create it as a class variable, so it's accessible elsewhere.

    --Eric
     
  29. Gorav kumar

    Gorav kumar

    Joined:
    Dec 28, 2015
    Posts:
    2
    hello, can i paint on 3d wall using brush at runtime and control the brush (size, colour, type) by Vectrosity. plz tell me
     
  30. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    Not really; that sounds like you should use a texture.

    --Eric
     
  31. Kinkku2

    Kinkku2

    Joined:
    Sep 29, 2014
    Posts:
    106
    Hi. I'm wondering, is there a way to layer lines that have been drawn in 2D with line.Draw function? As in other line going over another by default if it is on the correct layer. Or should I use Draw3D and layer the lines with the Z axis?

    Another thing I had in mind is that is it possible to record collisions between two drawn lines? I have a moving line element that is supposed to trigger from another line element when it hits it, but it doesn't seem to be working for me at the moment. Should it? I have a Rigidbody2D attached to the other moving line element.
     
    Last edited: Jan 5, 2016
  32. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    2D lines are layered in hierarchy order, like other things in the UI. You can use .drawDepth to change it. Collisions between lines aren't possible as far as I know (due to the colliders not registering, similar to how in 3D physics, mesh colliders don't interact with other mesh colliders).

    --Eric
     
  33. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    A 3D line is a standard GameObject with a mesh renderer, so the only reason I can think of why it might not appear is something to do with the shader you're using. Make sure it's a shader that works on mobile, and is being included in the build.

    --Eric
     
  34. Kinkku2

    Kinkku2

    Joined:
    Sep 29, 2014
    Posts:
    106
    Ok! Thank you for the answers. :)
     
  35. benjamin_playhybrid

    benjamin_playhybrid

    Joined:
    Feb 6, 2015
    Posts:
    5
    Howdy Eric,

    I'm using Vectrosity 4 to render a 3D spline (with a disabled orthographic camera pointing down so that it's flat on the ground). I'm having trouble with the line's width when the resolution changes -- it seems that Screen.width affects scaling on the width of vertical portions of the spline, while Screen.height affects scaling on the height of horizontal portions of the spline.

    Here's what happens if I scale the line width by the Screen.width and change my editor window size:




    You can see that the line width remains the same on the two nodes on the left, however on the topmost node, which is traversed horizontally, I get a thinner line.

    Is the non-uniform scaling intended? How can I get uniform width scaling for a 3D world space spline?
     
  36. benjamin_playhybrid

    benjamin_playhybrid

    Joined:
    Feb 6, 2015
    Posts:
    5
    Also, I noticed a lot of questions about drawDepth not working as intended -- if anyone is wondering, geometry that uses a Transparent shader (render queue >= 3000) is rendered in a separate pass regardless of its world position or location in the hierarchy, so setting drawDepth will have no effect on render order. You can set the render order for transparent elements by changing the shader's render queue priority or by changing the Material.renderQueue property on the material instance at runtime.
     
  37. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    Line width is in pixels, so it depends on the resolution used. With Vectrosity 5, DrawDepth is for 2D lines only, and works as intended since it sets the hierarchy order. Rendering order for 3D lines depends on the usual mesh/shader stuff. Vectrosity 4 uses the UI rendering for both 2D and 3D lines.

    --Eric
     
  38. benjamin_playhybrid

    benjamin_playhybrid

    Joined:
    Feb 6, 2015
    Posts:
    5
    Eric, that doesn't answer my question. Would you mind looking it over again? To reiterate, I'm getting curves that have a different width on horizontal parts and vertical parts after the screen is resized -- seems like a bug in Vectrosity. Shouldn't resolution changes result in a uniform scale being applied, based on either the width or height of the screen, as Unity canvases do?
     
  39. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    It's not a bug; Vectrosity line width is in screen pixels. It's drawing from the point of view of the camera that you're using, regardless of whether it's disabled. In any case, after changing resolution/screen size, lines should be redrawn.

    --Eric
     
  40. Kinkku2

    Kinkku2

    Joined:
    Sep 29, 2014
    Posts:
    106
    Hmm.. Is there a way to change the edge collider to a polygon collider? Would I be able to track objects that are staying within the VectorLine this way?
     
  41. benjamin_playhybrid

    benjamin_playhybrid

    Joined:
    Feb 6, 2015
    Posts:
    5
    Eric, when you say "redraw," am I expected to destroy all splines in the scene and rebuild them every time the aspect ratio changes? Because I am already redrawing every frame with Draw3D(), which produces the unwanted behavior you see in my screenshots.
     
  42. dred

    dred

    Joined:
    Apr 8, 2013
    Posts:
    30
    Hello,

    On unity 5.3.1 and vectrosity 5.2.1 i have strange effect:

    When camera zoom out from line, line become a little fade (base on distance). On unity 5.2.2 no fade effect. How to prevent this?

    And also I have on map a world space canvases and lines draws over this canvases(lines are 3D) how i can prevent this?
    Thanks.
     
    Last edited: Jan 8, 2016
  43. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    Discrete lines use a polygon collider; continuous lines use an edge collider.

    No, the way that Vectrosity works for Draw3D is that it uses Camera.WorldToScreenPoint, does line calculations based on pixels in screen space, then uses Camera.ScreenToWorldPoint to convert it back into world space. So it depends entirely on whatever the vector camera says the screen looks like. Perhaps you need to call SetCamera3D again after the screen changes, though if you haven't reset it for other lines, it shouldn't be necessary.

    I'm not really sure what you mean, since Vectrosity doesn't do any fade effects by default. Unless you're talking about ObjectSetup with Brightness.Fog, in which case see the docs for VectorManager.SetBrightnessParameters. For the second question, assuming you're using the default material that comes with Vectrosity, you can use a different shader that has z sorting, such as unlit/texture (note that this doesn't have vertex colors though).

    --Eric
     
  44. ecosky

    ecosky

    Joined:
    Sep 9, 2013
    Posts:
    3
    Hello,

    Really liking Vectrocity here. Is there any chance you might choose to add official support for Playmaker? There is a custom action set for an older version of Vectrocity that is incompatible with the current version of Vectrocity.

    I mentioned this to the Playmaker team and they said they'd look into it but a better long term solution would be if you were involved (http://hutonggames.com/playmakerforum/index.php?topic=11973.0).

    Here are the Playmaker actions I'm referring to: https://hutonggames.fogbugz.com/?W948

    Thanks!
     
  45. benjamin_playhybrid

    benjamin_playhybrid

    Joined:
    Feb 6, 2015
    Posts:
    5
    No, that had no effect. But destroying and reinstantiating the VectorLine every time the aspect ratio changes yielded the correct behavior.

    I understand that the incorrect behavior is not Vectrosity's "fault," but even if you are not intentionally applying the non-uniform scale to line widths yourself, you should be able to compensate for it fairly easily. I hope you'll investigate this further.
     
  46. tcederq

    tcederq

    Joined:
    Jan 13, 2014
    Posts:
    3
    Using an orthographic camera with a non standard negative clipping plane (mine are -400, 400 for near/far for the camera setup) when you rotate the camera where the clipping plane for part of the circle goes negative it breaks. I'm using a circle with 20 points and as the circle passes through 0 on the camera clipping plane it draws the edges into infinity making the circle a super long u and then eventually breaks completely as the entire circle passes through 0 it stops drawing. I am using the latest Unity3d. Is there a way around this issue? I have a panning/rotating/zooming camera that allows me to wander through a 3d map and using 0 as the near clipping plan culls too early and ruins the affect of the map. Open to suggestions.
     
  47. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    Could you use a separate camera with standard clipping planes for the lines?

    Thank you, but I don't use Playmaker or know much of anything about it, so I wouldn't be able to support it, sorry.

    --Eric
     
  48. tcederq

    tcederq

    Joined:
    Jan 13, 2014
    Posts:
    3
    Once drawn, could the vector object be compiled into a mesh? I can put it into the scene as a mesh and not worry about clipping planes at that point. I'm currently using Draw3DAuto().

    Otherwise, I may need to adjust the camera to fly and clip more naturally. I would expect a second camera to clip or have issues on rotation alignment as I'm using the vector library as a selection reticle so they need to stay in sync visually otherwise my reticle and the object its highlighting will diverge. The challenge is simply how much 3d data I have on screen at once and attempting to keep from clipping visual information.
     
  49. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,244
    It's already a mesh.

    --Eric
     
  50. tcederq

    tcederq

    Joined:
    Jan 13, 2014
    Posts:
    3
    I don't mean to sound like I know too much about what I'm talking about. I'm still very new to 3d programming. Ultimately I'm thinking if I had a gameobject or meshrenderer to build a gameobject from the circle you've computed, I can just place it in the scene via code like any other object. Instead it seems to redraw the circle for each frame based on the position of the camera which is what I'm looking to avoid at this point. Or am I thinking of this all wrong?
     
unityunity