|
@@ -10,28 +10,21 @@
|
|
<h1>[name]</h1>
|
|
<h1>[name]</h1>
|
|
|
|
|
|
<p class="desc">
|
|
<p class="desc">
|
|
- This buffer attribute class does not construct a VBO. Instead, it uses
|
|
|
|
- whatever VBO is passed in constructor and can later be altered via the
|
|
|
|
- *buffer* property.<br /><br />
|
|
|
|
- It is required to pass additional params alongside the VBO. Those are:
|
|
|
|
- the GL context, the GL data type, the number of components per vertex,
|
|
|
|
- the number of bytes per component, and the number of vertices.<br /><br />
|
|
|
|
- The most common use case for this class is when some kind of GPGPU
|
|
|
|
- calculation interferes or even produces the VBOs in question.
|
|
|
|
|
|
+ 此缓冲区属性类不构造 VBO。相反,它使用在构造函数中传递的任何 VBO,以后可以通过 缓冲区属性进行更改。<br /><br />
|
|
|
|
+ 它需要与 VBO 一起传递额外的参数。它们是:GL 上下文、GL 数据类型、每个顶点的组件数、每个组件的字节数和顶点数。<br /><br />
|
|
|
|
+ 此类最常见的用例是当某种 GPGPU 计算干扰甚至产生有问题的 VBO 时。
|
|
</p>
|
|
</p>
|
|
|
|
|
|
- <h2>Constructor</h2>
|
|
|
|
|
|
+ <h2>构造方法(Constructor)</h2>
|
|
<h3>[name]( [param:WebGLBuffer buffer], [param:GLenum type], [param:Integer itemSize], [param:Integer elementSize], [param:Integer count] )</h3>
|
|
<h3>[name]( [param:WebGLBuffer buffer], [param:GLenum type], [param:Integer itemSize], [param:Integer elementSize], [param:Integer count] )</h3>
|
|
<p>
|
|
<p>
|
|
- *buffer* — Must be a [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLBuffer WebGLBuffer].
|
|
|
|
|
|
+ *buffer* — 必须是 [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLBuffer WebGLBuffer].
|
|
<br />
|
|
<br />
|
|
- *type* — One of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Data_types WebGL Data Types].
|
|
|
|
|
|
+ *type* — [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Data_types WebGL数据类型]之一.
|
|
<br />
|
|
<br />
|
|
- *itemSize* — The number of values of the array that should be associated with
|
|
|
|
- a particular vertex. For instance, if this
|
|
|
|
- attribute is storing a 3-component vector (such as a position, normal, or color), then itemSize should be 3.
|
|
|
|
|
|
+ *itemSize* — 应与特定顶点关联的数组值的数量。例如,如果此属性存储一个3分量向量(例如位置、法线或颜色),则itemSize应为 3。
|
|
<br />
|
|
<br />
|
|
- *elementSize* — 1, 2 or 4. The corresponding size (in bytes) for the given "type" param.
|
|
|
|
|
|
+ *elementSize* — 1、2 或 4。给定的相应大小(以字节为单位)“类型”参数。
|
|
<ul>
|
|
<ul>
|
|
<li>gl.FLOAT: 4</li>
|
|
<li>gl.FLOAT: 4</li>
|
|
<li>gl.UNSIGNED_SHORT: 2</li>
|
|
<li>gl.UNSIGNED_SHORT: 2</li>
|
|
@@ -41,79 +34,77 @@
|
|
<li>gl.BYTE: 1</li>
|
|
<li>gl.BYTE: 1</li>
|
|
<li>gl.UNSIGNED_BYTE: 1</li>
|
|
<li>gl.UNSIGNED_BYTE: 1</li>
|
|
</ul>
|
|
</ul>
|
|
- *count* — The expected number of vertices in VBO.
|
|
|
|
|
|
+ *count* — VBO 中预期的顶点数。
|
|
</p>
|
|
</p>
|
|
|
|
|
|
- <h2>Properties</h2>
|
|
|
|
|
|
+ <h2>特性(Properties)</h2>
|
|
|
|
|
|
<h3>[property:WebGLBuffer buffer]</h3>
|
|
<h3>[property:WebGLBuffer buffer]</h3>
|
|
<p>
|
|
<p>
|
|
- The current [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLBuffer WebGLBuffer] instance.
|
|
|
|
|
|
+ 当前[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLBuffer WebGLBuffer]的实例.
|
|
</p>
|
|
</p>
|
|
|
|
|
|
<h3>[property:Integer count]</h3>
|
|
<h3>[property:Integer count]</h3>
|
|
<p>
|
|
<p>
|
|
- The expected number of vertices in VBO.
|
|
|
|
|
|
+ VBO 中的预期顶点数。
|
|
</p>
|
|
</p>
|
|
|
|
|
|
<h3>[property:Boolean isGLBufferAttribute]</h3>
|
|
<h3>[property:Boolean isGLBufferAttribute]</h3>
|
|
<p>
|
|
<p>
|
|
- Read-only. Always *true*.
|
|
|
|
|
|
+ 只读。值永远为"true"。
|
|
</p>
|
|
</p>
|
|
|
|
|
|
<h3>[property:Integer itemSize]</h3>
|
|
<h3>[property:Integer itemSize]</h3>
|
|
<p>
|
|
<p>
|
|
- How many values make up each item (vertex).
|
|
|
|
|
|
+ 每个项目(顶点)组成多少个值。
|
|
</p>
|
|
</p>
|
|
|
|
|
|
<h3>[property:Integer elementSize]</h3>
|
|
<h3>[property:Integer elementSize]</h3>
|
|
<p>
|
|
<p>
|
|
- Stores the corresponding size in bytes for the current *type* property value.
|
|
|
|
|
|
+ 存储当前类型属性值的相应大小(以字节为单位)。
|
|
</p>
|
|
</p>
|
|
<p>
|
|
<p>
|
|
- See above (constructor) for a list of known type sizes.
|
|
|
|
|
|
+ 有关已知类型大小的列表,请参见上面的(构造函数)。
|
|
</p>
|
|
</p>
|
|
|
|
|
|
<h3>[property:String name]</h3>
|
|
<h3>[property:String name]</h3>
|
|
<p>
|
|
<p>
|
|
- 该 attribute 实例的别名,默认值为空字符串。
|
|
|
|
|
|
+ 该attribute实例的别名,默认值为空字符串。
|
|
</p>
|
|
</p>
|
|
|
|
|
|
<h3>[property:GLenum type]</h3>
|
|
<h3>[property:GLenum type]</h3>
|
|
<p>
|
|
<p>
|
|
- A [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Data_types WebGL Data Type]
|
|
|
|
- describing the underlying VBO contents.
|
|
|
|
|
|
+ 描述底层 VBO 内容的[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Data_types WebGL数据类型]
|
|
</p>
|
|
</p>
|
|
<p>
|
|
<p>
|
|
- Set this property together with *elementSize*. The recommended way is
|
|
|
|
- using the *setType* method.
|
|
|
|
|
|
+ 将此属性与elementSize一起设置。推荐的方法是使用setType方法。
|
|
</p>
|
|
</p>
|
|
|
|
|
|
- <h2>Methods</h2>
|
|
|
|
|
|
+ <h2>方法(Methods)</h2>
|
|
|
|
|
|
<h3>[method:this setBuffer]( buffer ) </h3>
|
|
<h3>[method:this setBuffer]( buffer ) </h3>
|
|
- <p>Sets the *buffer* property.</p>
|
|
|
|
|
|
+ <p>设置缓冲区属性。</p>
|
|
|
|
|
|
<h3>[method:this setType]( type, elementSize ) </h3>
|
|
<h3>[method:this setType]( type, elementSize ) </h3>
|
|
- <p>Sets the both *type* and *elementSize* properties.</p>
|
|
|
|
|
|
+ <p>设置type和elementSize属性。</p>
|
|
|
|
|
|
<h3>[method:this setItemSize]( itemSize ) </h3>
|
|
<h3>[method:this setItemSize]( itemSize ) </h3>
|
|
- <p>Sets the *itemSize* property.</p>
|
|
|
|
|
|
+ <p>设置itemSize属性。</p>
|
|
|
|
|
|
<h3>[method:this setCount]( count ) </h3>
|
|
<h3>[method:this setCount]( count ) </h3>
|
|
- <p>Sets the *count* property.</p>
|
|
|
|
|
|
+ <p>设置计数属性。</p>
|
|
|
|
|
|
<h3>[property:Integer version]</h3>
|
|
<h3>[property:Integer version]</h3>
|
|
<p>
|
|
<p>
|
|
- A version number, incremented every time the needsUpdate property is set to true.
|
|
|
|
|
|
+ 版本号,每次将needsUpdate属性设置为true时递增。
|
|
</p>
|
|
</p>
|
|
|
|
|
|
<h3>[property:Boolean needsUpdate]</h3>
|
|
<h3>[property:Boolean needsUpdate]</h3>
|
|
<p>
|
|
<p>
|
|
- Default is *false*. Setting this to true increments [page:GLBufferAttribute.version version].
|
|
|
|
|
|
+ 默认为假。将此设置为 true 增量[page:GLBufferAttribute.version 版本]
|
|
</p>
|
|
</p>
|
|
|
|
|
|
- <h2>Source</h2>
|
|
|
|
|
|
+ <h2>源代码(Source)</h2>
|
|
<p>
|
|
<p>
|
|
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
|
|
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
|
|
</p>
|
|
</p>
|