x


How does Vectrosity scale textures?

How can I add a repeating "arrow" texture to a Vectrosity line?

I'm writing a game which includes a 2D map at the bottom of the screen. As the player advances, they place waypoints. The map shows these waypoints connected by lines. When I draw Vectrosity lines using a material without a texture, they look good (crisp lines with a reasonable thickness). I want to add an arrow texture to the line but I can't get the thickness of the line, the size of the texture and the scaling right.

I've created a 200x50 pixel PNG texture which is a line with an arrow in the middle. Here's what happens with various parameters.

So what size should I make my texture? How thick should I set the line? Why won't SetTextureScale(1) make my arrow repeat at regular intervals?

My code looks roughly like this:

VectorLine line = new VectorLine("path", waypoints, pathMaterial, width, LineType.Continuous);
Vector.SetTextureScale(line, 1f);
Vector.DrawLine3D(line);

Actually, I update the lines dynamically by modifying line.points3[], line.maxDrawIndex, and calling SetTextureScale() and DrawLine3D() every time. Possibly this is affecting the way they look but I hope not.

Any help appreciated.

more ▼

asked Jul 04 '12 at 02:07 PM

clfischer gravatar image

clfischer
51 1 3 5

Looks like you're using an old version of Vectrosity. There was an issue with SetTextureScale and 3D lines that was fixed a while ago.

Jul 05 '12 at 04:59 PM Eric5h5

You're right. I was using Vectrosity 1.5. I have now upgraded to version 2.0 but have the same issue when using line.SetTextureScale(1f). The website and e-mail say the latest version is 2.0.1 but the link from the e-mail gives me version 2.0. Not sure if this is an issue.

Jul 09 '12 at 11:37 AM clfischer

I guess I'd have to see more details then, because the code you posted above works fine in all cases that I can see.

Jul 09 '12 at 05:03 PM Eric5h5

Eventually I'll see if I can repeat the problem with a self-contained piece of code, and I'll try it with different texture sizes.

Jul 10 '12 at 10:00 AM clfischer
(comments are locked)
10|3000 characters needed characters left

1 answer: sort oldest

It seems to work with some textures but not others. I can't tell if this is due to the proportions of the texture, the size, or some other factor. Making my texture shorter helped, but I don't think my initial texture was longer than the segment I was trying to apply it to.

more ▼

answered Jul 09 '12 at 01:53 PM

clfischer gravatar image

clfischer
51 1 3 5

Using 1.0 for the texture scale might not be right, depending on the proportions of the texture. See the docs for uniform-scaled textures.

Jul 09 '12 at 05:04 PM Eric5h5

With my latest texture, it works with a scale of 1.0 (although I prefer the way it looks with 3.0). I tried the other textures with different scales but it made no difference: the texture didn't repeat.

Jul 10 '12 at 09:59 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:

x2188
x198
x32

asked: Jul 04 '12 at 02:07 PM

Seen: 489 times

Last Updated: Jul 10 '12 at 10:40 AM