Molehill & Away3D 4.0

To view the example click the image above – you will need the Flash Player 11 beta for it to run.

 

Finally just over 1 week after the beta release of Molehill and Flash Player 11, I have finally managed to spend some time to play with the new version of Away3D. So my intention today was to just get a model loaded and running, and firstly I was absolutely amazed at what a fantastic job the Away3D team have done with the new version of the engine, if you have ever done any AS3 programming with either Papervision or Away3D previously you will have no problem with this and even if you haven’t it is easy to pick up as the whole process has become a lot easier. Creating materials has been stream lined, in the example I have put together I am just using a simple ColorMaterial and simply by changing the ambient and specular amounts you can easily get very different effects. My materials are simply added like so:

ActionScript
< view plain text >
  1. material = new ColorMaterial(currentColour, 1);
  2. material.specular = currentSpecular;
  3. material.ambient = currentAmbient;
  4. material.ambientColor = 0x555555;
  5. material.diffuseMethod = new BasicDiffuseMethod();
  6. material.lights = [pl, pl2];
  7.  
  8. mesh.material = material;

with currentColour, currentSpecular & currentAmbient being values assigned by my components in this example, you can of course put your own variables and of course your own values. The rest of the example is pretty straight forward and just involves a View3D as you would expect a couple of PointLights and of course an enter frame event loop to render the scene each frame. I have also lifted the HoverDragController class from the Away3D examples.

The examples downloaded from the Away3D download pages go a long way in getting you started with some great work to build upon but also some amazing examples to show you what can be achieved.

What is most impressive about all of this is how smoothly it all runs. Even running the examples on my crappy Dell laptop with its measly ATI Radeon graphics card, most of the examples run perfectly at about 30 – 40 fps. I know there seems to be a bit of a WebGL vs Molehill thing going on at the moment, hey there is always a ‘something’ vs Flash thing going on – but I have never managed to get any WebGL example to run past 12 fps and most won’t run at all, so in my book that says a lot about how beautiful the the Molehill API is.

Next I want to have a play with getting some 2D objects running via Molehill which seems a really exciting prospect considering the popularity of frameworks such as Cocos2D for game dev…

If you want to download the source from my example you can get it here.

This entry was posted in Actionscript 3.0, AS3 3D, Away 3D, Molehill and tagged , . Bookmark the permalink.

7 Responses to Molehill & Away3D 4.0

  1. chris shaw says:

    anyone know how/if it’s possible to get callbacks for vertices in molehill or away3d? we want to do simple morphs, and ultimately, stuff like this:
    http://www.chrisshorts.com/haptekHeads1.html
    (we’re making all this code open source)

  2. sebastienk says:

    sorry i new to 3D world…
    how did you export your 3D mesh in .obj and .mtl ?

  3. sebastienk says:

    ok I found thanks

  4. who else? says:

    Nice work, pal!
    How could you get hold of the Unity3D Version 4 Beta?! Is this accessable for public, yet? I would like to get my hands on.. Is there a download-link for v.4 beta?

    Cheers

  5. who else? says:

    Hello?! Is Unity3D 4 beta available already? Where?

    Please tell me.. Thanks

  6. UltraVisual says:

    Hi

    Not sure where you would get the impression that I would even know this? Have you tried contacting someone at Unity for this information they are going to have much more of an idea on this than I would. Try http://twitter.com/higgyb as he is a Unity evangelist and would be able to help you I am sure.

    Shane

  7. cody says:

    Watch out world. Here comes the molehill!

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>