|
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: 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.
(comments are locked)
|
|
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. 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)
|

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.
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.
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.
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.