- 最后登录
- 2018-12-19
- 注册时间
- 2012-8-20
- 阅读权限
- 90
- 积分
- 54706
- 纳金币
- 32328
- 精华
- 41
|
线渲染器 Line Renderer
The Line Renderer takes an array of two or more points in 3D space and draws a straight line between each one. A single Line Renderer Component can thus be used to draw anything from a simple straight line, to a complex spiral. The line is always continuous; if you need to draw two or more completely separate lines, you should use multiple GameObjects, each with its own Line Renderer.
线渲染器(Line Renderer)有一个包含两个或更多3D空间中点的数组并在每两个点之间绘制平直的线。一个单独的线渲染器(Line Renderer)组件因此可以用来绘制任何东西,从一条简单的平直线到一条复杂的螺旋线。这些线一直是连续的;如果你需要绘制两条或更多完全间断的线,你需要使用多个游戏物体(GameObject),每一个都带有它们自己的线渲染器(Line Renderer)。
The Line Renderer does not render one pixel thin lines. It renders billboard lines that have width and can be textured. It uses the same algorithm for line rendering as the Trail Renderer.
线渲染器(Line Renderer)并不渲染一个像素宽的线。它渲染有宽度并可以被赋予贴图的告示板线。它使用与拖尾渲染器(TrailRenderer)相同的线渲染算法。
The Line Renderer Inspector 线渲染器检视面板
Properties 属性
Details 细节
To create a line renderer:
来创建一个线渲染器(Line Renderer):
1.Choose GameObject->Create Empty
选择菜单GameObject->Create Empty
2.Choose Component->Miscellaneous->Line Renderer
选择菜单Component->Miscellaneous->Line Renderer
3.Drag a texture or Material on the Line Renderer. It looks best if you use a particle shader in the Material.
拖拽一个贴图或者材质(Material)到线渲染器(Line Renderer)上。如果你在这个材质上使用一个粒子着色器会看上去非常好
Hints 提示
•Line Renderers are good to use for effects when you need to lay out all the vertices in one frame.
当你需要显示出一帧内所有的顶点时线渲染器(Line Renderer)用起来很好
•The lines may seem to rotate as you move the Camera. This is intentional.
当你移动摄像机(Camera)的时候这些线可能看上去在旋转。这是故意如此的
•The Line Renderer should be the only Renderer on a GameObject.
线渲染器(Line Render)应该是一个游戏物体(GameObject)上唯一的渲染器
【文章转载】 |
|