Skip to content

Commit 2757698

Browse files
committed
Update buffer attribute example
1 parent ec43169 commit 2757698

File tree

1 file changed

+41
-10
lines changed

1 file changed

+41
-10
lines changed

examples/BufferAttributes and BufferGeometry.ipynb

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@
108108
},
109109
{
110110
"cell_type": "code",
111-
"execution_count": 9,
111+
"execution_count": 16,
112112
"metadata": {},
113113
"outputs": [
114114
{
115115
"data": {
116116
"application/vnd.jupyter.widget-view+json": {
117-
"model_id": "37642eda6faf4d1091b88bca6647ad87",
117+
"model_id": "e8e9822fd24d4155b35d135128267f4f",
118118
"version_major": "2",
119119
"version_minor": "0"
120120
},
@@ -132,42 +132,73 @@
132132
},
133133
{
134134
"cell_type": "code",
135-
"execution_count": 10,
135+
"execution_count": 13,
136+
"metadata": {},
137+
"outputs": [],
138+
"source": [
139+
"vertices.array = np.array([\n",
140+
" [-1.0, -1.0, 1.0],\n",
141+
" [ 2.0, -2.0, 2.0],\n",
142+
" [ 1.0, 1.0, 1.0],\n",
143+
" \n",
144+
" [ 1.0, 1.0, 1.0],\n",
145+
" [-1.0, 1.0, 1.0],\n",
146+
" [-1.0, -1.0, 1.0],\n",
147+
" ])"
148+
]
149+
},
150+
{
151+
"cell_type": "code",
152+
"execution_count": 15,
153+
"metadata": {},
154+
"outputs": [],
155+
"source": [
156+
"geometry.attributes['position'] = vertices"
157+
]
158+
},
159+
{
160+
"cell_type": "code",
161+
"execution_count": 19,
136162
"metadata": {},
137163
"outputs": [
138164
{
139165
"data": {
140166
"text/plain": [
141-
"float"
167+
"{'position': BufferAttribute(array=array([[-1., -1., 1.],\n",
168+
" [ 2., -2., 2.],\n",
169+
" [ 1., 1., 1.],\n",
170+
" [ 1., 1., 1.],\n",
171+
" [-1., 1., 1.],\n",
172+
" [-1., -1., 1.]], dtype=float32), count=6, normalized=False, version=0)}"
142173
]
143174
},
144-
"execution_count": 10,
175+
"execution_count": 19,
145176
"metadata": {},
146177
"output_type": "execute_result"
147178
}
148179
],
149180
"source": [
150-
"np.float"
181+
"geometry.attributes"
151182
]
152183
},
153184
{
154185
"cell_type": "code",
155-
"execution_count": 11,
186+
"execution_count": 23,
156187
"metadata": {},
157188
"outputs": [
158189
{
159190
"data": {
160191
"text/plain": [
161-
"numpy.float64"
192+
"\"PlainBufferGeometry(attributes={'position': BufferAttribute(array=array([[-1., -1., 1.],\\n [ 2., -2., 2.],\\n [ 1., 1., 1.],\\n [ 1., 1., 1.],\\n [-1., 1., 1.],\\n [-1., -1., 1.]], dtype=float32), count=6, normalized=False, version=0)}, type='BufferGeometry')\""
162193
]
163194
},
164-
"execution_count": 11,
195+
"execution_count": 23,
165196
"metadata": {},
166197
"output_type": "execute_result"
167198
}
168199
],
169200
"source": [
170-
"np.float64"
201+
"repr(geometry)"
171202
]
172203
},
173204
{

0 commit comments

Comments
 (0)