damonky.co.uk - Web development | Illustration | Flex | Papervision | Actionscript | Devon

Mouse Constraints using Jiglib AS3

Actionscript Jiglib AS3

JiglibFlash is a great physics engine for the flash platform. Combined with Papervision 3D you can do some amazing stuff. The library has been recently updated and now not only contains a car physics model, but mouse constraints. The mouse contraint can add a new level of interactity to your scene.

I’ve been dying to try it out, and finally after moving house i finally got my lil studio / junk room setup. Below I have created a basic scene in which several block fall from the sky on init. These can then be picked up and thrown, interacting with other objects. Just a finishing touch I Though it would be good to have shadows. The code of which is from the brilliant Andy Zupko (Article on shadow casting). Anyway, I’ve provided the code below with ample commenting.

View Demo

Download JigLibFlash

Download Papervision

Download source
Share and Enjoy:
  • Digg
  • TwitThis
  • del.icio.us
  • TailRank
  • Facebook
  • Technorati
  • LinkedIn
  • Google

3 Responses to “Mouse Constraints using Jiglib AS3”

  1. mat says:
    hey, the example looks amazing,
    I’m trying to test it and play around with it on my pc, but I keep getting this error,

    1137: Incorrect number of arguments. Expected no more than 3.
    FlatShadeMaterial = new FlatShadeMaterial(pLight,0×999999,_BOX_COLOR,2);

    any ideas?

    thanks!
    ~matt
  2. admin says:
    Hi Matt, I’m glad you like it.

    I’ve checked the docs for FlatShadeMaterial and I Cant see any obvious reson why it would error here.

    Which version of papervision are you using? I tend to check out from the svn. In any case I have zipped the version of the libraries I used up and uploaded them here.

    Give these a try and let me know how you get on.

    Dave

Leave a Reply