Fork me on GitHub
Not signed in (Sign In)

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

    • CommentAuthorltpve74
    • CommentTimeSep 8th 2010
     
    Hi,

    I am trying to use a particle system to generate some sort of a fountain in 3d, I have the fountain but I would like to use and object3d as a particle.

    I have a class that creates a plane with the various parameters I need. can I use this plane as a particle?

    I have been looking at the documentation but can't figure out how to do it.

    thanks

    Luigi
    • CommentAuthorRichard
    • CommentTimeSep 9th 2010
     
    Hi

    You can use any Object3D as a particle. You need the A3DObjectClass initializer. To configure this initializer, you tell it how to create your Object3D. That is, what is the class, and what parameters does the class constructor require. Then, it will create a new instance of your class to be used by each particle.
    • CommentAuthorltpve74
    • CommentTimeSep 9th 2010
     
    Hi thanks for the response,
    do you have any example I can look at? at the moment I created a class that just creates a plane but if I feed the class to the A3DObjectClass it returns an error of

    1067: Implicit coercion of a value of type App:Sheet to an unrelated type Class.

    if I then create a reference class it runs but nothing is displayed on screen I can see that it is loading the object as the memory goes up but it doesn't show on screen.

    just a simple example of any Object3D and the A3DObjectClass would help me a lot.

    thanks again

    Luigi
    • CommentAuthorRichard
    • CommentTimeSep 10th 2010
     
    It sounds like you're passing an instance of the Sheet class to the A3DObjectClass initializer. You have to pass the class itself, so that the A3DObjectClass initializer can make an instance for each of your particles.

    Like this

    emitter.addInitializer( new A3DObjectClass( Sheet ) );

    not like this

    var s:Sheet = new Sheet();
    emitter.addInitializer( new A3DObjectClass( s ) );
    • CommentAuthorltpve74
    • CommentTimeSep 20th 2010
     
    Hi,
    ok that works with no errors but even though the class is called nothing shows on screen.

    does flint takes care of adding the object3D to the view?

    thanks
    • CommentAuthorltpve74
    • CommentTimeSep 20th 2010
     
    never mind, I was extending Obkect3D in my class instead of Plane, if I use Plane everything works.

    thanks anyway