javascript - Three.js - How to create smoke with Three.js? -
i want create brown smoke blowing in sky.
how can create this?
the shaderparticleengine received rewrite three.js-r72
heavy api changes, updating answer. see answers history comparison and/or settings shaderparticleengine 0.8
/ three.js-r71
.
allows user fine tune more parameters, create beautiful twisted smoke:
example settings emitter in screenshot:
var loader = new three.textureloader(); var url = 'assets/images/particles/cloudsml.png'; var texture = loader.load( url ); var particlegroupcrash = new spe.group({ texture: { value: texture }, blending: three.normalblending }); var crashemitter = new spe.emitter({ maxage: { value: 12 }, position: { value: new three.vector3( 0, 0, 0 ), spread: new three.vector3( 1, 0.5, 2 ), }, size: { value: [ 2, 8 ], spread: [ 0, 1, 2 ] }, acceleration: { value: new three.vector3( 0, 0, 0 ), }, rotation: { axis: new three.vector3( 0, 1, 0 ), spread: new three.vector3( 0, 20, 0 ), angle: 100 * math.pi / 180, }, velocity: { value: new three.vector3( 0, 1, -0.5 ), spread: new three.vector3( 0.25, 0.1, 0.25 ) }, opacity: { value: [ 0.2, 0.5, 0 ] }, color: { value: [ new three.color( 0x333333 ), new three.color( 0x111111 ) ], spread: [ new three.vector3( 0.2, 0.1, 0.1 ), new three.vector3( 0, 0, 0 ) ] }, particlecount: 600, });
three.js r73
Comments
Post a Comment