Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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. DavidByers

    DavidByers

    Joined:
    Dec 31, 2010
    Posts:
    79
    I figured I should post this game I'm working on titled Kid Vector that makes heavy use of Vectrocity. It really is a fantastic tool.

     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Really nice! Looks very polished for a first look.

    --Eric
     
  3. psdev

    psdev

    Joined:
    Feb 11, 2011
    Posts:
    53
    Hi Eric / any other knowledgeable Vectrosity users,

    I always feel a bit strange posting questions about a product I bought from the Asset Store in this unity forums "single-thread per add-on for all topics related to it", since it seems like I'm cluttering the thread and making it harder to search for a particular topic about Vectrosity, but this seems to be the protocol here, so here goes:

    I'm trying to animate lines getting drawn in 3D space using Vectrosity and trying to wrap my head around the best way to do so.

    I initially tried using DrawLine3DAuto, but I can't figure out how to update it on the fly in the Update() function if I want to change properties on the line - such as changing the lineWidth or maxDrawIndex properties in the Update() on a line created in the Start() - which doesn't appear to work if I use DrawLine3DAuto. I was under the impression that DrawLine3D creates the geometry newly every time you call it - so I cannot use it in Update() to animate a line as I'd be creating new lines every frame - unless I destroy the line first? Is that so?

    Here's a script I am using to test how to do things. This script works attached to a Main camera and creating 4 null points(empty game objects) in the scene (named as in the script) - I have a curved line based on those nulls that define the line. In this script I am using an F5 keypress to test animating the maxdrawIndex - which is how, I assume, you are supposed to animate the line being drawn? Does this look correct? It feels weird that I am destroying the line every frame - like it could be expensive cpu or cause flickering? Any downsides in doing it this way (on any platform if that matters) ?

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class LinesIn3DScript : MonoBehaviour
    5. {
    6.  
    7.     private VectorLine myline;
    8.     private float lastWidth;
    9.     private Material myMat;
    10.  
    11.     private GameObject CityFrom;
    12.     private GameObject CityTo;
    13.     private GameObject CityFromControl;
    14.     private GameObject CityToControl;
    15.    
    16.     private float dist;
    17.     private float tempLineWidth;
    18.    
    19.     private Vector3[] linePoints;
    20.     private int segmentIndex = 0;
    21.    
    22.     // Use this for initialization
    23.     void Start ()
    24.     {
    25.         CityFrom = GameObject.Find("CityFrom");
    26.         CityTo = GameObject.Find("CityTo");
    27.         CityFromControl = GameObject.Find("CityFromControl");
    28.         CityToControl = GameObject.Find("CityToControl");
    29.        
    30.         myMat = (Material)Resources.Load("MyMat");
    31.  
    32.         linePoints = new Vector3[] {CityFrom.transform.position, CityFromControl.transform.position,  CityToControl.transform.position, CityTo.transform.position};
    33.            
    34.         myline = new VectorLine("MyLine",new Vector3[51], myMat, 10.0f, LineType.Continuous, Joins.Weld);
    35.         Vector.MakeSplineInLine (myline, linePoints, 50);
    36.         //Vector.MakeCurveInLine (myline, linePoints,50);
    37.        
    38.         Vector.DrawLine3D(myline);
    39.        
    40.         lastWidth = Vector3.Distance(CityFrom.transform.position, camera.transform.position);
    41.     }
    42.    
    43.     // Update is called once per frame
    44.     void Update ()
    45.     {
    46. //      dist = Vector3.Distance(CityFrom.transform.position, camera.transform.position);
    47. //     
    48. //      tempLineWidth = 1/(dist/4f)*20;
    49. //     
    50. //      myline.lineWidth = tempLineWidth;
    51. //      if(lastWidth!= dist)
    52. //      {
    53. //          Vector.DrawLine3DAuto(myline);
    54. //          lastWidth = dist;
    55. //      }
    56.         if(Input.GetKey(KeyCode.F5))
    57.         {
    58.             Vector.DestroyLine(ref myline);
    59.             myline = new VectorLine("MyLine",new Vector3[51], myMat, 10.0f, LineType.Continuous, Joins.Weld);
    60.             Vector.MakeSplineInLine (myline, linePoints, 50);
    61.             segmentIndex = segmentIndex +1;
    62.             if (segmentIndex>50)
    63.             {
    64.                 segmentIndex = 1;
    65.             }
    66.             myline.maxDrawIndex = segmentIndex;
    67.            
    68.             Vector.DrawLine3D(myline);
    69.            
    70.         }
    71.     }
    72. }
    73.  
    Also, a couple more minor questions if you don't mind.

    1) The commented out block in the Update() function was a hack when I was using DrawLine3DAuto to figure out how to try and scale the line width based on the distance to camera - as it was initally odd for me that it was the same width no matter where in 3D space the line was - that makes sense for 2D overlayed lines, but to me not for 3D lines. Is this how you'd do it? Or is there a better way or a function in Vectrosity I can call that makes the line be a particular width in meters compared to other objects in the scene regardless of where it is in 3D space?

    2) If I wanted to tween animate this line drawing, I am trying to figure out how best to do that with iTween's ValueTo on the maxDrawIndex - but I'm not sure how to handle the destruction and recreation of the lines - is that done with the ValueTo's onUpdate? And if I want this line drawing animation to match another object travelling along the spline created by say a 50 segment MakeSplineInLine - how would I do that so the other gameObject can fly that path at the head of the maxDrawIndex exactly. An example snippet of code of something like that would be awesome.

    If I've missed something in the samples or up here on the forums, I'd appreciate if you could point the link out to me. Otherwise any other help would be greatly appreciated.

    thanks :)
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    The way to animate lines is generally to create the line in Start or wherever, then update the array of points used to make the line. See the selection box examples for the most basic illustration of that.

    Yeah, you generally shouldn't be destroying the line every frame; it creates both Mono and Unity garbage. As mentioned, create the points first, then animate them. For cases where you don't know how many points there will be, create a maximum and leave the unused ones at Vector2.zero or Vector3.zero. For this particular case it should work where you create the line first (outside of Update) and increase maxDrawIndex starting with 1 (since 0 means draw the whole line).

    Well, it's kind of the point of Vectrosity that lines are the same width, including 3D lines. There were a number of threads where people were trying to do wireframe models, for example, which was one of the original reasons for creating Vectrosity. You might want to use Unity's line renderer for lines that vary in width based on depth.

    I'm not sure iTween would really work for this. Generally you animate lines by updating values in the array; maxDrawIndex is primarily meant as an optimization. See the Path example scene for an animated object at the head of a path.

    --Eric
     
  5. Dev.D1

    Dev.D1

    Joined:
    Dec 29, 2010
    Posts:
    99
    Regardless of your opimisation of keeping the number of polygons the same, it's a similar scheme isn't it? Let me re-phrase my original statement, you're "adapting" the vertices positions to "fit" the curve better. Longer segments do not have needless tessellation. More curvy sections are represented by more polygon segments. Better? :) I'm just trying to understand your logic so I can extend it in my app. Cheers!
     
    Last edited: Feb 20, 2012
  6. DevWish

    DevWish

    Joined:
    Jun 26, 2011
    Posts:
    11
    Hi,

    I purchased Vectrosity last night, and just wanted to introduce myself. Love your work on this Eric, and even though I don't have a set project in mind to use this in, I just had to get Vectrosity to play with it! :razz:

    Guitboxgeek
     
  7. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Well, MakeSplineInLine has an effect like that, but it's actually just a nice side-effect of the GetSplinePoint function rather than me being particularly clever about anything. :)

    Thanks! It's generous of you to get it without a set project in mind, although I have to admit it is fun to play with...that's one reason there are quite a few examples....

    --Eric
     
  8. markhula

    markhula

    Joined:
    Sep 3, 2011
    Posts:
    630
    Hey there,

    We certainly could do with a dedicated forum for Vectrosity.
    Anyway, it's great!!
    I have an issue though; I wish to place an object along a spline but it needs to be at a specific distance (presumably world space units) irrespective of the length of the line:
    Currently:

    Code (csharp):
    1. do {
    2.         for (var dist = 0.0; dist < 1.0; dist += Time.deltaTime*speed) {
    3.             cube.position = Vector.GetLinePoint3D01 (line, dist);
    4.             yield;
    5.         }
    6.     } while (loop);
    But of the course the 'position' at say dist = 0.1f will vary depending on line length.
    How can I achieve the effect I wish?
    Also, how do I 'offset' from 1 spline? ; suppose I wish to follow a spline but have my x always 1f away from it...?. I am trying to get my object to 'walk along' the spline (imagine walking a tightrope); so i need to offset them from the spline somehow.

    Thanks in advance
     
    Last edited by a moderator: Feb 22, 2012
  9. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You can use GetLinePoint3D instead of GetLinePoint3D01.

    cube.position = Vector.GetLinePoint3D (line, dist) + Vector3.right?

    --Eric
     
  10. markhula

    markhula

    Joined:
    Sep 3, 2011
    Posts:
    630
    Hey Eric !

    Of course :)
    Thank you ; much appreciated
     
  11. pudd1nG

    pudd1nG

    Joined:
    Feb 21, 2012
    Posts:
    36
    This looks like the perfect asset for my project! Just a few questions.

    The use I envisage is letting the player draw a smooth 2d wall/line/spline as they would paint in photoshop. Would this be possible?
     
    Last edited: Feb 22, 2012
  12. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Yes, also there's a sample script included that does this.

    --Eric
     
  13. Lord_Pall

    Lord_Pall

    Joined:
    Sep 25, 2009
    Posts:
    52
    Is flash support in the works, or on hold until the full release?
     
  14. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Flash publishing is too unfinished for me to be able to support it. Right now it fails on code that has no workarounds (such as specifying a ref variable).

    --Eric
     
  15. pudd1nG

    pudd1nG

    Joined:
    Feb 21, 2012
    Posts:
    36
    Hi Eric, just got this from the asset store and it looks great. I've got a line draw happening just the way I want it. One problem though is I can't find where I would apply box (or even mesh) collider for these lines that are being drawn. Any tips?

    Cheers for a great asset!
     
  16. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You can access myLine.vectorObject for the game object that's used for the line, so theoretically you could apply a mesh collider to that, but that's unlikely to be a good solution, since the collider would have to be updated whenever the line is redrawn, and updating a mesh collider isn't fast (depending on how many segments are in the line). It might be a better idea to use the line point data to make a series of box colliders.

    --Eric
     
  17. BigB

    BigB

    Joined:
    Oct 16, 2008
    Posts:
    672
    Hi Eric,

    I have been using Vectrosity for quite a while now, and I just found a problem, not sure if it's a bug or not, but it seems it is.
    I have Vectrosity to render several lines in a scene, no problem at all.
    Inside my game, I then load other scene with other lines, and now, the lines won't be rendered anymore., I get this error :


    MissingReferenceException: The object of type 'Camera' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    UnityEngine.Camera.WorldToScreenPoint (Vector3 position) (at
    Vector.LineContinuous (.VectorLine vectorLine, Int32 end, System.Int32 idx, Matrix4x4 thisMatrix, Boolean doTransform) (at Assets/Standard Assets/VectorScripts/Vector.cs:530)
    Vector.DrawLine (.VectorLine vectorLine, UnityEngine.Transform thisTransform, Boolean useTransformMatrix) (at Assets/Standard Assets/VectorScripts/Vector.cs:373)
    Vector.DrawLine (.VectorLine vectorLine) (at Assets/Standard Assets/VectorScripts/Vector.cs:345)


    Basically, it crashes in this DrawLine function.

    Vector.SetColor(line1, lineColors);
    Vector.DrawLine(line1);
    lineColors.a = 1.0;

    Somehow, when changing scene, it seems line1 is not deleted or something of the kind.
    Do you have a clue on what is happening ?
    Maybe this is not happening in a newer version of Vectrosity (I hate to upgrade at this point so close to release), but anyways, how can I get the newer version ?

    Thanks,
    Bruno
     
    Last edited: Feb 28, 2012
  18. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Try calling SetCamera again after changing levels (see the Setting the Camera section in the docs). As for upgrading, update emails are sent out with new versions if you have update notices turned on. If you bought Vectrosity before the download link system, then update notices are on by default. If you don't get update notices, it could be 1) you have them turned off (see the download link email for directions for turning them on), or 2) they are going into your spam folder, or 3) your ISP is Comcast and won't deliver mail from starscenesoftware.com because of defective spam blocking. (In which case you can contact them and ask them to sort it out, or use something like gmail that works.) If you send me the email address you used when buying Vectrosity, I'll send out an update notice to that address.

    --Eric
     
  19. BigB

    BigB

    Joined:
    Oct 16, 2008
    Posts:
    672
    I will check out the SetCamera.
    Sent you a PM with mails info.

    Thanks,
    Bruno
     
  20. BigB

    BigB

    Joined:
    Oct 16, 2008
    Posts:
    672
    Hi Eric,

    SetCamera did fix the problem, I now have the lines in the levels after loading the scene being rendered, however immediately after I load a new level, I get the lines from the previous level being rendered.
    Once I move the camera the lines from the new level are displayed correctly.
    I tried calling Vector.Destroy before calling SetCamera but this did not fix the problem.
    Is there a way to delete the previous lines ?

    thanks,
    Bruno
     
  21. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    How are you drawing the lines? For example, this works without issues:

    Code (csharp):
    1. function Start () {
    2.     var line = new VectorLine ("test", [Vector2(0, 200), Vector2(Screen.width, 200)], null, 4.0);
    3.     Vector.DrawLine (line);
    4.     yield WaitForSeconds(2);
    5.     Application.LoadLevel(1);
    6. }
    The next level is a scene that draws a different line:

    Code (csharp):
    1. function Start () {
    2.     Vector.SetCamera();
    3.     var line = new VectorLine ("test2", [Vector2(200, 0), Vector2(200, Screen.height)], null, 2.0);
    4.     Vector.DrawLine (line);
    5. }
    I don't see the line from the previous level.

    --Eric
     
  22. markhula

    markhula

    Joined:
    Sep 3, 2011
    Posts:
    630
    Hi Eric,

    I am trying to do something simple (as always) but can't get it to work.
    I need to draw my line in 3d and adjust the height of each point as you touch the landscape in 'y' i.e. so the line is always 'above' whatever you are touching.

    Code (csharp):
    1.  
    2. Vector3 d = (point);
    3.                 d.y = 1f;
    4.                 draw_points.Add(d);
    5.                 print("adding"+d);
    6.                
    7.                 if (draw_points.Count >= 2)
    8.                 {
    9.                     //draw = new VectorLine("draw",new Vector3[250+1], null , 10 ,LineType.Continuous);
    10.                     draw = new VectorPoints("draw",new Vector3[250+1], null , 10);
    11.                     Vector.MakeSplineInLine(draw,draw_points.ToArray(),250, false);
    12.                     //Vector.SetLineParameters(Color.cyan,null,10,1,2,LineType.Continuous,Joins.None);
    13.                     //Vector.MakeLine("draw",draw_points.ToArray(),Color.cyan);
    14.                     Vector.DrawPoints3D(draw);
    15.                 }  
    16.  
    Unless I makespline ; nothing gets draw though I don't want a spline.
    I *assumed* I want vector points; but don't know. I guess in theory I want to draw a line between each point (once your finger moves a certain magnitude I guess). i see in the example's a simple 2d example of this - so presume I am doing something fundamentally wrong :)
    Any help appreciated

    Cheers
     
  23. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You have to put something in the points array; right now you have "new Vector3[250+1]", which makes an empty Vector3 array with 251 entries. MakeSpline will put something in the points array, which is why it draws something, but you just need some actual data.

    --Eric
     
  24. markhula

    markhula

    Joined:
    Sep 3, 2011
    Posts:
    630
    Thanks I see.
    I did try with 'make line' as you can see; but equally nothing was drawn.
    If I did want just points; how should I add them?

    Cheers
     
  25. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You probably want to read the docs, specifically starting on page 6 where it describes VectorLines and how to set them up with line point data. Especially see the example on the bottom of page 8 where it initializes a points array, then fills the array with data and draws the line.

    --Eric
     
  26. markhula

    markhula

    Joined:
    Sep 3, 2011
    Posts:
    630
    Thanks; forgive my newbie questions :)

    Cheers
     
  27. markhula

    markhula

    Joined:
    Sep 3, 2011
    Posts:
    630
    Hi Eric,

    Ok; I've got it all working great apart from one thing.
    I wish to not draw the line at a certain point.
    Just doing DestroyLine; doesn't seem to do it.
    I also quickly scanned through this long thread and tried :
    ZeroPointsinLine
    Destroyline

    This didn't seem to work either. May I ask how I undraw (and also destroy) the actual line?

    Thanks in advance

    EDIT: have it working now. Need to create the vector line object just once :)
     
    Last edited: Mar 7, 2012
  28. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    If you want to disable a line temporarily, use VectorLine.active.

    --Eric
     
  29. markhula

    markhula

    Joined:
    Sep 3, 2011
    Posts:
    630
    Thanks.
    Have noticed a real strange thing. I have a situation where the vectorline object is created:

    dots = new VectorLine("line_grapple",points,Color.cyan,null,4.0f);

    but dots.vectorObject is always null - can't see why....

    Cheers
     
  30. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    As far as I know that could only happen if the line failed to create (such as by trying to use an array with >16K points), because otherwise nothing would be drawn since the actual line object wouldn't exist.

    --Eric
     
  31. markhula

    markhula

    Joined:
    Sep 3, 2011
    Posts:
    630
    It's very strange.
    I printed out the value and it is there for the 1st frame and then becomes null even though it's not been adjusted!!

    Cheers
     
  32. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    I think you must be resetting it somehow.

    --Eric
     
  33. markhula

    markhula

    Joined:
    Sep 3, 2011
    Posts:
    630
    The only thing I do.
    Is Onstart() I set it.
    Then I disable the script; then enable it later when I wish to use it.
    Could that cause an issue??

    Cheers
     
  34. markhula

    markhula

    Joined:
    Sep 3, 2011
    Posts:
    630
    Ok, I have found the problem but don't understand the reason :)

    in my on start() I new my vector line

    The script then gets disabled.
    I then do a scene load
    I then re-enable my script

    my vector line.vectorobject is null.

    I tested this By forcing the script to stay disabled, scene load and then manually enabling the script everything was fine.
    So I am guessing application load messes up something????.
    It's strange that the vectorline survives but not vectorline.vectorobject

    And yeah, the game object with these scripts attached is set to don't destroy on load.

    Any ideas?

    Cheers
     
  35. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Which destroys all game objects in the scene, including line objects. (VectorLine itself survives because it's not a game object.) You can re-create lines after changing scenes, or use DontDestroyOnLoad.

    --Eric
     
  36. markhula

    markhula

    Joined:
    Sep 3, 2011
    Posts:
    630
    Hey!

    Hmmm, I see. I assumed dontdestroy onload saved everything from death :)

    Cheers
     
  37. masterchafe

    masterchafe

    Joined:
    Oct 2, 2011
    Posts:
    59
    Hi Eric5h5, I've been using Vectrosity daily for a month or so now, and loving it, and have ran into something I'm not sure of what to do with.

    I'm creating a line, using MakeSplineInLine and DrawLine3D, that is getting increasingly further away from the camera on the Z. What I've noticed, when I move my camera over to the end of the line, is that the thickness of the line gets increasingly larger the further away from the camera it is. How can I stop this from happening?
     
  38. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Do you have a screenshot?

    --Eric
     
  39. masterchafe

    masterchafe

    Joined:
    Oct 2, 2011
    Posts:
    59
    Sure. I sent you a pm.
     
  40. benfattino

    benfattino

    Joined:
    Nov 26, 2010
    Posts:
    43
    Hi. Hope somebody help me. I need to draw a wireframe model (about 100.000 lines) that will rotate constantly. I know is a lot of lines.
    I am using this script (attached to a cube), but it isn't work.
    N.B. The rotation is controlled by another script found on unity site.

    Is it the best way? What is the best way for performance?
    I try to use DrawLine3D command, but performance is slow. Help!
     
  41. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You "line" variable only exists in Start. It needs to use a global variable (which you've defined, but not used). DrawLine is faster than DrawLine3D, yes.

    --Eric
     
  42. psdev

    psdev

    Joined:
    Feb 11, 2011
    Posts:
    53
    quick question:

    How do you get 3D lines to be occluded by geometry? I'm drawing a curved line between 2 points on a sphere (like a flight plan) but when I look at the sphere from the other side of it I can still see the line drawing through it as if the sphere's polys don't occlude it at all. Is this a layer issue? How do you get it so that 3D lines are in the scene and affected by lights and everything? thanks
     
  43. psdev

    psdev

    Joined:
    Feb 11, 2011
    Posts:
    53
    Also is there any way to get the 3D lines geometry to be generated like a tube instead of a ribbon? The flat lines dont look good from some angles for my purposes.
     
  44. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    If you use DrawLine3D, then the line is drawn in the scene (rather than being overlaid in a separate layer like DrawLine), and will be occluded by objects. However, it won't be affected by lights, since this requires normals, which are not generated.

    No, but the idea is that you update the 3D lines whenever the camera moves, so they always face the camera. You can use DrawLine3DAuto for this if you don't want to do it manually.

    --Eric
     
  45. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    This is kind of a long shot, but I had someone write a question on my website with a "maryni.net" address, which doesn't seem to exist. I'd love to answer the question (in fact, I have), but I can't send the answer without a valid address. So if you happen to read this, let me know what the address is, thanks!

    --Eric
     
  46. tilluigi

    tilluigi

    Joined:
    Mar 15, 2012
    Posts:
    4
    hi eric, great stuff. instant buy!

    in your examples i see lines fading in and out (like the mesh or the thick light-blue line in the image on the first page of this thread).

    can i achieve this effect without using the SetBrightnessParameters?

    please see attached mockup to get an idea of what i want to achieve.

    thanks for your help!
     

    Attached Files:

  47. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Thanks! SetBrightnessParameters is for the "fog" that can be used for 3D line objects controlled by VectorManager. In this case, you'd want to use SetColorsSmooth, and probably 5 or so segments for each line.

    --Eric
     
  48. tilluigi

    tilluigi

    Joined:
    Mar 15, 2012
    Posts:
    4
    i see, thanks. any tipp on how to automatically segment the line, which now is only 2-points from A-B?
     
  49. psdev

    psdev

    Joined:
    Feb 11, 2011
    Posts:
    53
    I am using DrawLine3DAuto and the line is not occluded by the globe. Any idea why this might be happening?



    thanks :)
     
  50. psdev

    psdev

    Joined:
    Feb 11, 2011
    Posts:
    53
    Sorry nevermind. Turns out it was my material shader - DOH!
     
Thread Status:
Not open for further replies.