Skip to content

粒子火焰

ts
function addFire() {
    const particle = new Cesium.ParticleSystem({
        image: FireImage,
        startColor: Cesium.Color.RED.withAlpha(0.1),
        endColor: Cesium.Color.YELLOW.withAlpha(0.5),
        startScale: 10,
        endScale: 5,
        minimumParticleLife: 50,
        maximumParticleLife: 100,
        minimumSpeed: 20,
        maximumSpeed: 30,
        imageSize: new Cesium.Cartesian2(1, 1),
        sizeInMeters: true,
        // Particles per second.
        emissionRate: 100,
        // lifetime: 60.0,
        emitter: new Cesium.CircleEmitter(10.0),
        modelMatrix: computeModelMatrix({lon: 116.45, lat: 39.932, alt: 4}),
        emitterModelMatrix: computeEmitterModelMatrix(),
        updateCallback: applyGravity
    })

    viewer.value.scene.primitives.add(particle);
    viewer.value.camera.setView({
        destination: Cesium.Cartesian3.fromDegrees(116.45, 39.932, 3000)
    })
}

By Modify.