You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`index` (Type: number)<br>A numeric index, starting from 0, that identifies a value stored in the attribute's buffer. For example, 0 identifies the first value, 1 identifies the second, and so on.
99
49
100
50
#### Return Value
101
51
102
52
Return value. (Type: *)
103
53
104
-
<aname='H3DU.BufferHelper_getBuffer'></a>
105
-
### H3DU.BufferHelper#getBuffer(a)
106
-
107
-
Gets a reference to the buffer used in the given vertex attribute object.
*`index` (Type: number)<br>A numeric index, starting from 0, that identifies a value stored in the attribute's buffer. For example, 0 identifies the first value, 1 identifies the second, and so on.
130
66
*`vec` (Type: Array.<number>)<br>An array whose elements will be set to those of the value at the given index. The number of elements copied to this array is the attribute's count per value (see H3DU.BufferHelper.countPerValue).
Creates a <ahref="H3DU.BufferHelper.md">vertex attribute object</a>.
140
-
Each value in the attribute will be initialized to all zeros.
141
-
142
-
#### Parameters
143
-
144
-
*`semantic` (Type: number | string)<br>An attribute semantic, such as <ahref="H3DU.Semantic.md#H3DU.Semantic.POSITION">H3DU.Semantic.POSITION</a>, "POSITION", or "TEXCOORD_0". Throws an error if this value is a string and the string is invalid.
145
-
*`semanticIndex` (Type: number)<br>The set index of the attribute for the given semantic. 0 is the first index of the attribute, 1 is the second, and so on. This is ignored if "semantic" is a string.
146
-
*`count` (Type: number)<br>Number of values. Each value describes the attribute's value for the corresponding vertex.
147
-
*`countPerValue` (Type: number)<br>Number of elements (numbers) for each value.
148
-
149
-
#### Return Value
150
-
151
-
A new vertex attribute with blank values. (Type: Array.<Object>)
152
-
153
72
<aname='H3DU.BufferHelper_makeIndices'></a>
154
73
### H3DU.BufferHelper#makeIndices(numIndices)
155
74
@@ -167,23 +86,20 @@ An array of vertex indices. (Type: Uint16Array | Uint32Array)
Merges two vertex attributes, whose vertices can be indexed differently, into one
170
-
combined vertex attribute. The two attributes must have the same semantic and semantic
171
-
index, for example, semantic POSITION and semantic index 0.
89
+
combined vertex attribute.
172
90
173
91
#### Parameters
174
92
175
-
*`attr1` (Type: Array.<Object>)<br>A <ahref="H3DU.BufferHelper.md">vertex attribute object</a> for the first vertex attribute. Can be null, in which case it is assumed that the attribute contains as many values as indices and all the values are zeros.
93
+
*`attr1` (Type: H3DU.BufferAccessor)<br>A vertex buffer accessor for the first vertex attribute. Can be null, in which case it is assumed that the attribute contains as many values as indices and all the values are zeros.
176
94
*`indices1` (Type: Array.<number> | Uint16Array | Uint8Array | Uint32Array)<br>An array of vertex indices associated with the first vertex attribute.
177
-
*`attr2` (Type: Array.<Object>)<br>A <ahref="H3DU.BufferHelper.md">vertex attribute object</a> for the second vertex attribute. Can be null, in which case it is assumed that the attribute contains as many values as indices and all the values are zeros.
95
+
*`attr2` (Type: H3DU.BufferAccessor)<br>A vertex buffer accessor for the second vertex attribute. Can be null, in which case it is assumed that the attribute contains as many values as indices and all the values are zeros.
178
96
*`indices2` (Type: Array.<number> | Uint16Array | Uint8Array | Uint32Array)<br>An array of vertex indices associated with the second vertex attribute.
179
97
180
98
#### Return Value
181
99
182
100
The merged attribute, where the vertices from the first vertex
183
101
attribute come before those from the second. The merged attribute will have as many
184
-
values as the sum of the lengths of "indices1" and "indices2".
185
-
Returns null if the two objects have different semantics
186
-
or semantic indices. (Type: Array.<Object>)
102
+
values as the sum of the lengths of "indices1" and "indices2". (Type: H3DU.BufferAccessor)
*`index` (Type: number)<br>A numeric index, starting from 0, that identifies a value stored in the attribute's buffer. For example, 0 identifies the first value, 1 identifies the second, and so on.
233
135
*`value` (Type: number)<br>The number to set the first element to.
*`index` (Type: number)<br>A numeric index, starting from 0, that identifies a value stored in the attribute's buffer. For example, 0 identifies the first value, 1 identifies the second, and so on.
252
154
*`vec` (Type: Array.<number>)<br>An array containing the elements to copy to the value at the given index. The number of elements copied is this array's length or the attribute's count per value (see H3DU.BufferHelper.countPerValue), whichever is less.
Copy file name to clipboardExpand all lines: doc/H3DU.CurveBuilder.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,8 +31,8 @@ Sets the parametric curve used to generate vertex attribute values.
31
31
32
32
*`curve` (Type: Object)<br>A <ahref="H3DU.Curve.md">curve evaluator object</a> that describes the parametric curve used to generate attribute.
33
33
*`semantic` (Type: number | string)<br>An attribute semantic, such as <ahref="H3DU.Semantic.md#H3DU.Semantic.POSITION">H3DU.Semantic.POSITION</a>, "POSITION", or "TEXCOORD_0". Throws an error if this value is a string and the string is invalid.
34
-
*`semanticIndex` (Type: number)<br>The set index of the attribute for the given semantic. 0 is the first index of the attribute, 1 is the second, and so on. This is ignored if "name" is a string.
35
-
*`size` (Type: number) (optional)<br>The number of elements in each position value. For example, if the attribute is 3-dimensional, this parameter is 3. If null, undefined, or omitted, the default is 3.
34
+
*`semanticIndex` (Type: number)<br>The set index of the attribute for the given semantic. 0 is the first index of the attribute, 1 is the second, and so on. This is ignored if "name" is a string. If null or undefined, this value is 0.
35
+
*`size` (Type: number) (optional)<br>The number of elements in each position value. For example, if the attribute is 3-dimensional, this parameter is 3. If null, undefined, or omitted, the default is 3. Throws an error if this value is 0 or less.
36
36
37
37
#### Return Value
38
38
@@ -91,7 +91,7 @@ Sets the parametric curve used to generate vertex positions.
91
91
#### Parameters
92
92
93
93
*`curve` (Type: Object)<br>A <ahref="H3DU.Curve.md">curve evaluator object</a> that describes the parametric curve used to generate positions.
94
-
*`size` (Type: number) (optional)<br>The number of elements in each position value. For example, if the attribute is 3-dimensional, this parameter is 3. If null, undefined, or omitted, the default is 3.
94
+
*`size` (Type: number) (optional)<br>The number of elements in each position value. For example, if the attribute is 3-dimensional, this parameter is 3. If null, undefined, or omitted, the default is 3. Throws an error if this value is 0 or less.
Copy file name to clipboardExpand all lines: doc/H3DU.MeshBuffer.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,8 +64,8 @@ Gets a vertex attribute included in this mesh buffer.
64
64
65
65
#### Return Value
66
66
67
-
A <ahref="H3DU.BufferHelper.md">vertex attribute object</a>, or null
68
-
if the attribute doesn't exist. (Type: Array.<Object>)
67
+
A vertex buffer accessor, or null
68
+
if the attribute doesn't exist. (Type: H3DU.BufferAccessor)
69
69
70
70
<aname='H3DU.MeshBuffer_getBounds'></a>
71
71
### H3DU.MeshBuffer#getBounds()
@@ -252,8 +252,8 @@ stored in a vertex buffer.
252
252
*`index` (Type: number)<br>The set index of the attribute for the given semantic. 0 is the first index of the attribute, 1 is the second, and so on. This is ignored if "name" is a string.
253
253
*`buffer` (Type: Float32Array | Array)<br>The buffer where the per-vertex data is stored.
254
254
*`startIndex` (Type: number)<br>The index into the array (starting from 0) where the first per-vertex item starts.
255
-
*`countPerVertex` (Type: number)<br>The number of elements in each per-vertex item. For example, if each vertex is a 3-element vector, this value is 3.
256
-
*`stride` (Type: number) (optional)<br>The number of elements from the start of one per-vertex item to the start of the next. If null, undefined, or omitted, this value is the same as "countPerVertex".
255
+
*`countPerVertex` (Type: number)<br>The number of elements in each per-vertex item. For example, if each vertex is a 3-element vector, this value is 3. Throws an error if this value is 0 or less.
256
+
*`stride` (Type: number) (optional)<br>The number of elements from the start of one per-vertex item to the start of the next. If null, undefined, or omitted, this value is the same as "countPerVertex". Throws an error if this value is 0 or less.
Copy file name to clipboardExpand all lines: doc/H3DU.SurfaceBuilder.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,8 +39,8 @@ Sets the parametric surface used to generate vertex attribute values.
39
39
40
40
*`surface` (Type: Object)<br>A <ahref="H3DU.Surface.md">surface evaluator object</a> that describes the parametric surface used to generate attribute's values.
41
41
*`semantic` (Type: number | string)<br>An attribute semantic, such as <ahref="H3DU.Semantic.md#H3DU.Semantic.POSITION">H3DU.Semantic.POSITION</a>, "POSITION", or "TEXCOORD_0". Throws an error if this value is a string and the string is invalid.
42
-
*`semanticIndex` (Type: number) (optional)<br>The set index of the attribute for the given semantic. 0 is the first index of the attribute, 1 is the second, and so on. This is ignored if "name" is a string.
43
-
*`size` (Type: number) (optional)<br>The number of elements in each position and normal. For example, if the attribute is 3-dimensional, this parameter is 3. If null, undefined, or omitted, the default is 3.
42
+
*`semanticIndex` (Type: number) (optional)<br>The set index of the attribute for the given semantic. 0 is the first index of the attribute, 1 is the second, and so on. This is ignored if "name" is a string. If null or undefined, this value is 0.
43
+
*`size` (Type: number) (optional)<br>The number of elements in each position and normal. For example, if the attribute is 3-dimensional, this parameter is 3. If null, undefined, or omitted, the default is 3. Throws an error if this value is 0 or less.
44
44
45
45
#### Return Value
46
46
@@ -93,7 +93,7 @@ TODO: Not documented yet.
93
93
#### Parameters
94
94
95
95
*`surface` (Type: Object)<br>A <ahref="H3DU.Surface.md">surface evaluator object</a> that describes the parametric surface used to generate position values.
96
-
*`size` (Type: number) (optional)<br>The number of elements in each position value. For example, if the attribute is 3-dimensional, this parameter is 3. If null, undefined, or omitted, the default is 3.
96
+
*`size` (Type: number) (optional)<br>The number of elements in each position value. For example, if the attribute is 3-dimensional, this parameter is 3. If null, undefined, or omitted, the default is 3. Throws an error if this value is 0 or less.
97
97
98
98
#### Return Value
99
99
@@ -107,7 +107,7 @@ Sets the parametric surface used to generate vertex positions and normals.
107
107
#### Parameters
108
108
109
109
*`surface` (Type: Object)<br>A <ahref="H3DU.Surface.md">surface evaluator object</a> that describes the parametric surface used to generate positions.
110
-
*`size` (Type: number) (optional)<br>The number of elements in each position and normal. For example, if the attribute is 3-dimensional, this parameter is 3. If null, undefined, or omitted, the default is 3.
110
+
*`size` (Type: number) (optional)<br>The number of elements in each position and normal. For example, if the attribute is 3-dimensional, this parameter is 3. If null, undefined, or omitted, the default is 3. Throws an error if this value is 0 or less.
111
111
112
112
#### Return Value
113
113
@@ -139,7 +139,7 @@ from (0,1) along the U and V axes of the surface.
139
139
#### Parameters
140
140
141
141
*`surface` (Type: Object)<br>A <ahref="H3DU.Surface.md">surface evaluator object</a> that describes the parametric surface used to generate positions.
142
-
*`size` (Type: number) (optional)<br>The number of elements in each position. For example, if the attribute is 3-dimensional, this parameter is 3. If null, undefined, or omitted, the default is 3. The texture coordinates will be 2-dimensional.
142
+
*`size` (Type: number) (optional)<br>The number of elements in each position. For example, if the attribute is 3-dimensional, this parameter is 3. If null, undefined, or omitted, the default is 3. The texture coordinates will be 2-dimensional. Throws an error if this value is 0 or less.
0 commit comments