- 最后登录
- 2014-10-23
- 注册时间
- 2011-7-19
- 阅读权限
- 90
- 积分
- 81303
 
- 纳金币
- -1
- 精华
- 11
|
Vectrosity
So you just want to draw some lines in Unity and are tired of struggling with the LineRenderer? You don't have Unity Pro or you find GL.LINES too limiting anyway? Welcome to Vectrosity! Draw all sorts of vectors, grids, graphs, and just plain lines, fast and easy. You can even make GameObjects behave like 3D vector objects with a couple lines of code. Get Vectrosity now
•Works with Unity iPhone
•You can make hundreds or thousands of separate lines, each with their own color, with only one draw call.
•You only need to update lines when they change, so static lines take no extra CPU time.
•Continuously redrawing lines every frame is still fast, with low-end computers updating over half a million line segments per second.
•You can draw anti-aliased lines without needing FSAA (which doesn’t exist in current iPhone hardware), or make them glow without needing Pro-only full-screen image effects.
•Make 3D vector objects that behave like regular game objects. Can be used for various special effects, like the x-ray demo (right).
•Can draw points, too.
•Extensive user’s guide and reference guide to all functions.
•Includes a number of example scenes, and the complete project for the retro Tank Zone vector graphics game is included free!
How it works
Vectrosity uses a mesh-based solution, with a separate camera overlay. This is handled automatically and is transparent to you, the user. Once the line is drawn, it stays on-screen permanently until changed or removed. To start, just call
Vector.SetCamera();
once to set everything up. Make some points in a Vector2 or Vector3 array, which can be any size up to around 16,000 elements (Vectrosity uses screen space for the coordinates):
var linePoints = new Vector2[ Vector2(0, 0),
Vector2(Screen.width-1, Screen.height-1) ];
Then make a VectorLine object, giving it a name, the points, a material, the line width in pixels, and an end cap length:
var myLine = new VectorLine ("Line", linePoints, lineMaterial, 2, 0);
Then draw the line:
Vector.DrawLine (myLine);
Presto, you have a 2-pixel-thick line that extends from one corner of the screen to the other. You can update the points and call Vector.DrawLine again whenever you like. You can also pass the transform of an object to DrawLine in order to move or rotate lines without having to recompute them.
This is just the start...there are lots more options and functions available to make things easy and to accomplish various effects. Vectrosity is written in C#, but you don’t have to know C# to use it, and the complete functionality is available in any language. Just make sure the Vectrosity classes are in the Standard Assets folder if you’re using Javascript or Boo.
官网介绍:http://starscenesoftware.com/vectrosity.html |
|