经常看到这样一些场景:漫天飞舞的雪花、夜晚草丛中点点萤光、小河上下起的绵绵细雨…
这些浪漫??的效果都可以用粒子系统来实现,粒子系统用THREE.js实现就是通过Points
或者Sprite
类来实现的啦。
一、Points
A class for displaying points. The points are rendered by the WebGLRenderer using gl.POINTS.
所以Points
类就是通过 gl.POINTS
来渲染的。
构造函数
Points( geometry : Geometry, material : Material )
各参数说明:
geometry
— (optional) an instance of Geometry
or BufferGeometry
. Default is a new BufferGeometry.
material
— (optional) a Material. Default is a new PointsMaterial
with a random color.
Geometry
和BufferGeometry
的说明如下:
BufferGeometry
An efficient representation of mesh, line, or point geometry. Includes vertex positions, face indices, normals, colors, UVs, and custom attributes within buffers, reducing the cost of passing all this data to the GPU.
GeometryGeometry is a user-friendly alternative to BufferGeometry. Geometries store attributes (vertex positions, faces, color