x


Vectrosity line with arrow

I'm currently trying to create an editor allowing the user to make a tree graph by creating nodes and edges. Right now I'm using Vectrosity to draw out the edges and it's working great. But as it is intended to be a directed graph, it would be visibly more intuitive if the edges had an arrow to indicate direction.

Is there any way to draw arrows with Vectrosity or otherwise?

alt text

more ▼

asked Jun 07 '12 at 02:32 AM

ziomagica gravatar image

ziomagica
0 1 2 4

What is "Vectrosity"?

Jun 07 '12 at 03:03 AM kolban

It's a great line-drawing tool on the asset store, you might want to check it out if you want lines in your game

http://starscenesoftware.com/vectrosity.html

Jun 07 '12 at 03:14 AM ziomagica
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

You could use some kind of arrow texture along with SetTextureScale, so the lines would look something like this:

alt text

more ▼

answered Jun 07 '12 at 03:27 AM

Eric5h5 gravatar image

Eric5h5
80.1k 41 132 519

Trying out this idea, but pretty bad at art stuffs so not too sure how to set textures and stuff.

I'm using this now:

// copied this off the default material from Vectrosity

Material mat = new Material("Shader "Vertex Colors/Alpha" {Category{Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}SubShader {Cull Off ZWrite On Blend SrcAlpha OneMinusSrcAlpha Pass {BindChannels {Bind "Color", color Bind "Vertex", vertex}}}}}");

mat.SetTexture("_MainTex", arrowTexture);

VectorLine newEdge = new VectorLine("Edge", points, Color.cyan, mat, 5f, LineType.Discrete);

newEdge.SetTextureScale(1.0f);

newEdge.Draw3DAuto();

So far I'm not seeing the texture, a normal line is still being drawn. I must be doing something wrong with setting the texture, can anyone help please?

Jun 07 '12 at 07:26 AM ziomagica

Create the material in Unity, make a public variable for the material, drag the material you made onto the appropriate slot in the inspector, and use that variable when creating the VectorLine. See any of the examples that use dot/dashed lines.

Jun 07 '12 at 07:57 AM Eric5h5

Did this work for you? I'm trying to achieve something similar but the texture always gets stretched and blurred.

Jul 04 '12 at 02:54 PM clfischer

Use SetTextureScale.

Jul 04 '12 at 11:09 PM Eric5h5

Thanks Eric. I've tried this but the result isn't what I expect. It's as if one column of pixels gets repeated but not the rest of the texture. Either my arrow still appears only once in each segment, or it appears in the first segment and all the following segments are either single or triple lines. I need to get some pics up on my other post to illustrate.

Jul 05 '12 at 09:40 AM clfischer
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x32

asked: Jun 07 '12 at 02:32 AM

Seen: 746 times

Last Updated: Jul 05 '12 at 11:05 AM