原文在這:http://unity3d.com/support/documentation/Components/class-LineRenderer.html

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.

線段渲染器在3D空間內需要兩個或更多的點為一組,而在每個點之間繪製直線。ㄧ個單獨的線段渲染元件可以用於繪製任何東西從一個單存的直線,到複雜的螺旋;假如你需要繪製兩個或多個完全獨立的線段,你應該使用多個GameObjects,每個都擁有線段渲染。

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.

線段渲染不是只有渲染單一像素在線段上。它是渲染 billboard 線段,所以可以有寬度而且可以有貼圖。線段渲染它使用了像Trail Renderer的同樣算法。


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.
 位置 3向量的點去連接的陣列
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:

創建一個線段渲染

  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.
    拖曳一個貼圖或材質到線段渲染上。假如你在材質使用particle shader它看起來最好。

Hints(要點)

  • Line Renderers are good to use for effects when you need to lay out all the vertices in one frame.
    當你需要在一個框架下鋪滿全部的點,線段渲染是很好使用的特效。
  • The lines may seem to rotate as you move the Camera. This is intentional.
    線段看起來似乎在旋轉當你移動鏡頭時。這是故意的。
  • The Line Renderer should be the only Renderer on a GameObject.
    線段渲染應只能渲染在一個GameObject。
arrow
arrow
    全站熱搜

    深雪 發表在 痞客邦 留言(0) 人氣()