Papervision 3d Digital Clock

3 Comments 19 July 2009

This is something I created to kill time whilst on a long train journey to see my folks this weekend – yeah yeah OK, coding for fun on the train isn’t so cool, but I had intended to watch the second series of Flight Of The Conchords and I had the wrong codex so the videos wouldn’t play. I was left with nothing much to do and started playing around with Flash (as you do). I had the idea to create a digital clock in Papervision using cubes quite a while ago so it was a good time to finally build it.

You can view the clock here – I have set it up to use completely random colours, so it might look nice, or it might be pink and yellow (if it looks ugly just refresh your browser for different colours!)

Every project I do in Papervision I learn something new and this experiment was no exception. You may have read my recent post How to make DisplayObject3D alpha work in Papervision. Basically you have to set the useOwnContainer variable to true, which renders out the object onto it’s own ViewportLayer. I originally did this for the clock, so I could do some nice fading transitions between digits. However, this was inadvertently causing some strange Z-ordering issues as shown in the image below.

So I’m guessing that’s why Papervision doesn’t automatically set useOwnContainer when you alter the alpha (or add filters and change blendModes), as you need to consider the effects of using separate ViewportLayers when creating your applications, as it may mess up your Z-ordering.

Since I’m back in London now and it’s late I’m yet to figure out a suitable way around this, I’m thinking that perhaps altering the alpha of the material rather than the cube should do the trick, but I will experiment when I get more time, and post my fix here.

Posted in 3D, ActionScript, Papervision

3 Responses to Papervision 3d Digital Clock

  1. 28 September 2009

    hey stephen… my fake 3d clock:

    nice to see you the other day… hopefully catch up sometime.

  2. 29 September 2009

    Yeh good to see you too mate – nice experiments on your site too, a osc is very cool.

  3. How to make DisplayObject3D alpha work in Papervision | Flash Monkey

    [...] Think careful where and how you use useOwnContainer has it may cause Z ordering issues as described in this post. [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>