|
@@ -34,7 +34,7 @@
|
|
<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - buffergeometry custom attributes example - particles</div>
|
|
<div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - buffergeometry custom attributes example - particles</div>
|
|
<div id="container"></div>
|
|
<div id="container"></div>
|
|
|
|
|
|
- <script src="../build/three.min.js"></script>
|
|
|
|
|
|
+ <script src="../build/three.js"></script>
|
|
<script src="../src/renderers/WebGLRenderer.js"></script>
|
|
<script src="../src/renderers/WebGLRenderer.js"></script>
|
|
|
|
|
|
<script src="js/Detector.js"></script>
|
|
<script src="js/Detector.js"></script>
|
|
@@ -137,24 +137,11 @@
|
|
|
|
|
|
geometry = new THREE.BufferGeometry();
|
|
geometry = new THREE.BufferGeometry();
|
|
// geometry.dynamic = true;
|
|
// geometry.dynamic = true;
|
|
- geometry.attributes = {
|
|
|
|
-
|
|
|
|
- position: {
|
|
|
|
- itemSize: 3,
|
|
|
|
- array: new Float32Array( particles * 3 )
|
|
|
|
- },
|
|
|
|
- customColor: {
|
|
|
|
- itemSize: 3,
|
|
|
|
- array: new Float32Array( particles * 3 )
|
|
|
|
- },
|
|
|
|
- size: {
|
|
|
|
- itemSize: 1,
|
|
|
|
- array: new Float32Array( particles ),
|
|
|
|
- dynamic: true
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
+ geometry.addAtribute( 'position', Float32Array, particles, 3 );
|
|
|
|
+ geometry.addAtribute( 'customColor', Float32Array, particles, 3 );
|
|
|
|
+ geometry.addAtribute( 'size', Float32Array, particles, 1 );
|
|
|
|
+ geometry.attributes.size.dynamic = true;
|
|
|
|
|
|
values_size = geometry.attributes.size.array;
|
|
values_size = geometry.attributes.size.array;
|
|
var positions = geometry.attributes.position.array;
|
|
var positions = geometry.attributes.position.array;
|