Papervision3D snow

I don’t know about you guys, but at the moment I’m getting several calls a day asking for Flash Christmas cards. And what do you need in a Flash Christmas card? Christmas snow! Remember last year I completed the 3D-Flash-snow-in-15-minutes challenge at FlashBrighton’s Big Day Out? Well this year I thought I’d do the same thing with Papervision; now you can add snow to your own 3D scenes!

Snowstorm is a DisplayObject3D so you just add it to your scene. And there’s also a Snowflake.as file too.

new SnowStorm( quantity, flakeSize, cubesize);

It basically makes a big cube full of snow flakes! The parameters should be fairly self explanatory. :-)

Download the source here.

Bookmark and Share

Related posts:

  1. Flash snow in 15 minutes!
  2. Changing a cube's material dynamically in Papervision3D
  3. Papervision "billboard" particles
  4. Papervision interactive Line3D
  5. Animated Perlin Clouds in Papervision3D

27 Responses to “Papervision3D snow”

  1. var model:DAE = new DAE();
    model.load(“snowplough.dae”);
    scene.addChild(model);
    :D

  2. steve says:

    Very nice effect! It was a little disorienting when it spun so it was going away from you. Thanks for sharing. Merry Christmas!

  3. simonconlin says:

    Seb that’s so handy I just have to use it
    you just made everyone’s next digital Christmas message 700% better
    many thanks

  4. James says:

    Heh, cool effect. A nice way to step this years’ e-cards up a notch on last years’

  5. neil manuell says:

    that’s so pretty! I wanna catch it on my tongue:)

  6. gordee says:

    Nice one Seb – I might actually send virtual christmas cards this year now!

  7. slopester says:

    real nice Seb – I really need to have a proper look at that particle stuff – makes me realise how shallow my PV (and AS3!) knowledge is when I read your classes! Very cool.
    RIP 2d snow… you have served me well …. :o )

  8. chonny says:

    How to use it in flex 3 app?

  9. [...] In fact, there really was no let up in December, I built a particle based sparkly Christmas card for the BBC and put together a Christmassy Flash augmented reality demo for local geek group £5app which utilised my Papervision snow. [...]

  10. Guille says:

    Hi there! Thanks for sharing this!
    I have a problem though…I addChild the snowstorm to my scene, but I see nothing, yet I don’t get any output error.

    Am I missing something?

    There is another thing to, When I first published, the output yielded this:

    SnowFlake.as, Line21 1152:A conflict exists with inherited definition org.papervision3d.core.geom.renderables:Particle.rotationZ in namespace public

    so I commented the line in SnowFlake.as. Does this have to do with the aforementioned problem?

    Thanks a lot
    -g

  11. Harp says:

    Awesome looking storm script, thanks. No matter how I add this line to my AS project I get an error saying its expecting a right paran before the colon:
    new SnowStorm(quantity:int=200, flakeSize:Number=32, cubesize : Number = 400);
    This is what I was trying actually:
    var snow:SnowStorm = new SnowStorm( quantity:int=200, flakeSize:Number=32, cubesize:Number = 400);

    Any ideas why I get a syntax error there? Thanks.

  12. sorry, my bad, I just copy pasted from the constructor. Use the syntax :

    var snow:SnowStorm = new SnowStorm(200, 32, 400);

    cheers! (And merry christmas ;-) )

  13. Harp says:

    Thanks, fixed it. Now I get the same error as Guille above: 1152: A conflict exists with inherited definition org.papervision3d.core.geom.renderables:Particle.rotationZ in namespace public.

    Sorry to bug you man(and merry christmas!)

  14. Ah yes, that’s because I added a rotationZ property to the base Particle class. Just delete the offending line :

    public var rotationZ : Number = 0;

    and that should work. Let me know!

  15. Harp says:

    Same results as Guille, as in no error, no snow. I was trying to add your snow to a FLAR project that existed. I’m gong to try and implement just your snow in a new flex project. I’m rusty though!

  16. karajus says:

    Hi, to make it work you hace to call snowStorm.update() on each frame. For example:

    this.addEventListener(Event.ENTER_FRAME, onEnterFrame);

    private var snowStorm:SnowStorm

    private function onEnterFrame (evt:Event) :void {
    if (this.snowStorm)
    snowStorm.update();

    }

  17. Sherlack says:

    I’m trying to use this code in augmentation reality using Flar but it doesnt seem to be working. Anyone have made this work in Flar AR?

    THanks

  18. Hi Sherlack, I’ve used it in AR before – see http://vimeo.com/2498374 – it should just work!

  19. Veronica says:

    Error 1046! what´s that? i am new on this 3d flash and i do not understand what do i hace to write in the timeline appart from importing the class… please i d love to give this for my mom in these xmas! forgive me for my bad english, kisses from montevideo, Urugua… id love to learn papervision

  20. @Veronica, I’ve no idea! Sorry!

  21. Christian says:

    Anyone else having problems getting this to work with the latest build of PV3D? I am extending basic view, adding the SnowStorm instance to the scene and calling the update function inside an ENTER_FRAME event handler.

    I am not getting any errors, just don’t see anything being rendered.

  22. Christian says:

    Never mind, got it figured out. SnowStorm var I was referencing was created at a local scope rather than global, so the update function wasn’t being called properly. Oops :)

    • Mahmoodjm says:

      hi Christian,
      can you please publish your code here,
      because I have a problem like yours and I cant figure it out.
      thanks mate

  23. Greg says:

    Thanks Seb! I was on a tight deadline to make it snow on the holiday page. Your class did the trick. http://www.mattel.com/holiday
    I’m usually involved in non 3D interfaces so I did not have time to experiment. I am sure I will be doing more game development though so I will keep reading your blog. Too bad for me your on a different continent.

    Thanks again
    Greg

  24. Mahmoodjm says:

    Hi everybody
    I am using the exact instructions but it seems that I cant make this work.
    please share the complete code here.
    I really need to make it work right now.
    thanks

Leave a Reply

Bad Behavior has blocked 1363 access attempts in the last 7 days.