学习ThreeJS 10

BufferAttribute

https://threejs.org/docs/#api/core/BufferAttribute
各种法线, 面, 颜色, uv等自定义参数的集合
可以把Buffer想成是个稍微功能多一些的数组

//(存储数组, 每个块大小(比如一个空间的点由三个浮点数组成, 一般化/标准化)
BufferAttribute( array, itemSize, normalized )

normalized为true, 则把数值缩进到01/-11之间
如果为false, 则把数值直接改为浮点数

BufferGeometry

https://threejs.org/docs/#api/core/BufferGeometry

var geometry = new THREE.BufferGeometry();
// create a simple square shape. We duplicate the top left and bottom right
// vertices because each vertex needs to appear once per triangle.
var vertices = new Float32Array( [
    -1.0, -1.0,  1.0,
     1.0, -1.0,  1.0,
     1.0,  1.0,  1.0,

     1.0,  1.0,  1.0,
    -1.0,  1.0,  1.0,
    -1.0, -1.0,  1.0
] );
// itemSize = 3 because there are 3 values (components) per vertex
geometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
var material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
var mesh = new THREE.Mesh( geometry, material );

Clock

如果可以则使用 performance.now().
至少要使用 Date.now().

你可能感兴趣的:(学习ThreeJS 10)