IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

ModelParticle3D QML Type

Particle using a Qt Quick 3D Model.

This type was introduced in Qt 6.2.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

ModelParticle3D QML Type

  • Import Statement: import QtQuick3D.Particles3D

  • Since:: Qt 6.2

  • Inherits:: Particle3D

Detailed Description

The ModelParticle3D is a logical particle element that creates particles from a Qt Quick 3D Model component.

Property Documentation

 

delegate : Component

The delegate provides a template defining each object instantiated by the particle.

For example, to allocate 200 red cube particles:

 
Sélectionnez
Component {
    id: particleComponent
    Model {
        source: "#Cube"
        scale: Qt.vector3d(0.2, 0.2, 0.2)
        materials: DefaultMaterial { }
    }
}

ModelParticle3D {
    id: particleRed
    delegate: particleComponent
    maxAmount: 200
    color: "#ff0000"
}

instanceTable : Instancing

The instanceTable provides access to the Instancing table of the model particle. ModelParticle3D uses an internal instance table to implement efficient rendering. This table can be applied to the instancing property of models that are not part of the particle system.

It is also possible to use this feature to provide an instancing table without showing any particles. This is done by omitting the delegate property. For example:

 
Sélectionnez
ParticleSystem3D {
    id: psystem
    ModelParticle3D {
        id: particleRed
        maxAmount: 200
        color: "#ff0000"
        colorVariation: Qt.vector4d(0.5,0.5,0.5,0.5)
    }

    ParticleEmitter3D {
        particle: particleRed
        velocity: VectorDirection3D {
            direction: Qt.vector3d(-20, 200, 0)
            directionVariation: Qt.vector3d(20, 20, 20)
        }
        particleScale: 0.2
        emitRate: 20
        lifeSpan: 2000
    }
}

Model {
    source: "#Sphere"
    instancing: particleRed.instanceTable
    materials: PrincipledMaterial {
        baseColor: "yellow"
    }
}

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+