- 最后登录
- 2018-12-19
- 注册时间
- 2012-8-20
- 阅读权限
- 90
- 积分
- 54706
- 纳金币
- 32328
- 精华
- 41
|
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 属性]
---------------------------------------------------------------------------------
Materials 材质
The first material from this list is used to render the lines.
这个列表的第一个材质用于渲染这些线
Positions 定位
Array of Vector3 points to connect.
用于连接Vector3类型点的数组
Size 大小
The number of segments in this line. 这条线中的段数
Parameters 参数
List of parameters for each line: 每一条线的参数列表
StartWidth 开始宽度
Width at the first line position. 线的第一个位置处的宽度
EndWidth 结束宽度
Width at the last line position. 线的最后一个位置的宽度
Start Color 开始颜色
Color at the first line position. 线的第一个位置的颜色
End Color 结束颜色
Color at the last line position. 线的最后一个位置的颜色
Use World Space 使用世界坐标
If enabled, the object's position is ignored, and the lines are rendered around world origin.
如果设置为允许,物体的位置被忽略,并且相对于世界原点来渲染线
[Details 细节]
---------------------------------------------------------------------------------
To create a line renderer:
来创建一个线渲染器(Line Renderer):
Choose GameObject->Create Empty
选择菜单GameObject->Create Empty
Choose Component->Miscellaneous->Line Renderer
选择菜单Component->Miscellaneous->Line Renderer
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)上唯一的渲染器
【来源:互联网】
更多精彩教程,尽在web3D纳金网http://www.narkii.com/college/
|
|