THREE.js 粒子系统

本文介绍了THREE.js中用于创建粒子效果的Points类和Sprite类,详细阐述了Points的BufferGeometry与Geometry的区别以及PointsMaterial的使用。同时,展示了Sprite作为始终面向相机的平面,不投射阴影的特性。文中包含构造函数参数解释及使用示例,帮助读者深入理解THREE.js的粒子与精灵系统。
摘要由CSDN通过智能技术生成

经常看到这样一些场景:漫天飞舞的雪花、夜晚草丛中点点萤光、小河上下起的绵绵细雨…
这些浪漫??的效果都可以用粒子系统来实现,粒子系统用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.

  • GeometryBufferGeometry的说明如下:

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.

Geometry

Geometry is a user-friendly alternative to BufferGeometry. Geometries store attributes (vertex positions, faces, color

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值