Posts Tagged ‘PHYSICS’

Thursday, April 23rd, 2009

@bartek from everydayflash.com is an amazing 3d flash designer and developer.  The latest from everydayflash is a sample using MouseConstraint in JiglibFlash the 3d physics engine for all major flash 3d engines.

It is easy to see how the latest version of JiglibFlash with MouseConstraint will be heavily influencing flash games and applications very soon. This is a very smooth and quick demo that feels very responsive on the controls.  There are so many possible uses for JiglibFlash now that the MouseConstraint is available.  It will evolve further but this version seems ready to start integrating into many flash game and interactive ideas and projects. Even though it is still alpha it has been heavily cleaned up and a plugin system added by bartek for pluggable 3d render engines.  That is a huge step for 3d pipelines in flash.

Great work JiglibFlash team!

Tuesday, April 14th, 2009

JiglibFlash has been updated on a few fronts

Recently added include, you can now use RADIANS or DEGREES to manipulate objects in the engine, also adding standard yaw, pitch and roll methods.  

There is a mouse interaction now available with a MouseConstraint class to allow the user to drag a 3d element with the mouse which is great for gaming and interactive 3d physics scenes.

New class: MouseConstraint

There has been a new class to the Papervision3D plug-in called MouseConstraint and a new example to the Papervision3D examples folder. The class basically allows you to attach a world constraint to an object and simulate dragging.

The best update though is you can now use any of the major open source flash 3d engines as the renderer: Papervision 3D, Away3D or Sandy.

AS3 Flash 3D Physics Engines

Saturday, February 28th, 2009

Alchemy is going to shake things up a bit.  As witnessed before from Quake running in flash and now ODE compiled to run in flash using Alchemy (LLVM based). It is an early test but shows what could be possible.

Mihai Pricope has a post with sources on how he got the ODE (Open Dynamics Engine) a great open source physics engine for 3D, running on the AVM2 Flash Player virtual machine.

I’ve took Alchemy for a test and decided to compile ODE (Open Dynamic Engine). Just to add yet another physics engine to the Flash World. It was a hell of a ride but I finally got to produce some bouncing balls :). For a still unknown reason some as 3d libraries have been very slow to render 6 translucent walls and 2 balls. Papervision3D seems to move quite decent.

You can download the ode sources from here. To recompile them do (you need to have the Alchemy environment turned on):

Flash 10 will become mainstream shortly and with that the possibilities of using Alchemy in your projects is becoming a reality for production.  But what specifically can you do with Alchemy, a project that helps to compile C/C++ code into AVM2 capable files?

Alchemy described from Adobe:

With Alchemy, Web application developers can now reuse hundreds of millions of lines of existing open source C and C++ client or server-side code on the Flash Platform.  Alchemy brings the power of high performance C and C++ libraries to Web applications with minimal degradation on AVM2.  The C/C++ code is compiled to ActionScript 3.0 as a SWF or SWC that runs on Adobe Flash Player 10 or Adobe AIR 1.5.

Alchemy is based on the LLVM Low Level Virtual Machine that allows new levels of code translation.  Maybe this can lead to more effective and performing code to run on the iPhone with flash player 10. Or some type of system that allows flash developers to code in AS3 or take projects and get them ready to run on the iPhone much like some of the Java to Cocoa compilation systems and Unity3D using mono to compile down to iPhone capable code.

Wednesday, February 18th, 2009

Box2D is responsible for inspiring many 2d physics engines including Motor2, Box2DFlashAS3 and others.  Box2D the original toolkit is a solid c++ physics engine that has many great examples and features including real collision.

Now it has inspired a pure Javascript version of Box2D called Box2Djs to (using prototype dependency) to implement many of the same demos using the same functionality.  So it appears Box2D if you want to find a baseline standard physics kit for 2D, it now has versions in many languages that might allow you to have 2d physics capabilities across many platforms.

Box2DJS is a JavaScript port of Box2D Physics Engine. To tell the truth, this is converted from Box2DFlashAS3_1.4.3.1 in an automatic manner. (The reason why not Box2DFlashAS3_2.0.0 based is simply because I overlooked the renewal.)

Dependencies

  • prototype.js
  • IECanvas (when you use a canvas tag to display the result of your physics simulation)

Links

How to use

  1. Download a zip file and extract it.
  2. Copy js/ and lib/ directories from the extracted directory to your app directory.
  3. Copy script tags in the header part of index.html in the extacted directory to your html file where you want to simulate physics.

    Because this library does not have a lazy-loading system now, you should load all classes before starting your simulation. To make things worse, each library has a bit complicated dependency each other so that loading libraries in wrong order may cause a fatal error. To avoid such a trouble, it is strongly recommended to copy the header part of this file or `index.html’ including the downloaded zip file.

  4. Utilizing Box2D APIs, simulate the newton world as you like.

    The Box2DJS APIs are completely same as those of Box2DFlashAS3. Please refer information about it.

Also the speed of your javascript engine makes a big difference just like the AS2 AVM1 to the AS3 AVM2 virtual machines.  Chrome is much faster than FF3.

Video of Box2DJS in Chrome

Video of Box2DJS in FF3

Monday, January 12th, 2009


(use arrow keys and spacebar to control the red ball)

A new 3d physics library is under development and in early stages called jiglibflash.  Like the Box2D ports it is based on a C++ library of the same name called jiglib, only this is 3D instead of 2D.  It is similar in purpose to WOW Engine which is the other current open source 3d flash physics engine.  For more on this toolkit see the links below.

UPDATE: katopz has also ported this to use Away3D as the renderer.

UPDATE: Also updated for the sandy3d engine as the renderer.

Tuesday, July 29th, 2008

I rarely mention stuff I have worked on here but I got a chance to use APE and AS3 on the online Plinko game at the site for the Price is Right videogame for the famed pink Plinko Board.  Who doesn’t love Plinko?

I did the programming on this back when I still worked at emarketing/prizelogic.

I will be featuring a small iteration to APE with draggable particles and how I did it.  In the end I didn’t use the draggable particles but they are fun (i ended up changing my collision/border particles after testing).  I ended up controlling the drop location by swapping out a wheel particle after they dropped it.  So that it got the famous Plinko disc bounce and roll.

Why did I use APE? Well it is the least complex physics engine.  I started off with Box2dFlashAS3 and will post that one maybe as well but ended up going with APE mainly for integration it was easier that it was a less intensive codebase.  Box2DFlashAS3 can scare non C++ coders with it’s style let alone AS2 coders moving to AS3.

It is slower with all the other animation going on in the site but you can also play on my server here just the Plinko part.

Can you get 10,000?

Saturday, July 26th, 2008

Roxik has a 3d physics engine of his own. This is the same dude that did the well done pictaps site.

Looks like he also recently added an engine for cloth.

Also the bones demo is pretty sweet

Thursday, April 17th, 2008

Box2dFlashAS3 has been updated to version 2.0 complete with ragdolls and Theo Jansen walkers ala APE fame.

Sunday, April 6th, 2008

Nicolas Cannasse, a virtual machine genius (maker of MTASC compiler, Neko and haXe (haXe compiles to target flash 6-9 but really only flash 9 is used anymore unless you are making banners)) released the Physaxe 2D Physics kit for haXe today.

It is heavily based on Glaze (demos) and Box2D which the Motor2, Glaze and Box2DFlashAS3 physics kits are all based on. Box2D is a great C++ 2D physics engine, it is simple which lended itself to being ported to AS3 quite easily. It is also a testament to AS3 that C++ kits are being ported into the language, not once, but many times. Also C ports like Chipmunk and other signs point to == AS3 is of fun.

Physaxe is quite amazing you must see the demos (very similar to Glade demos), it will get the inspirational wheels turning in your idea machines.

2D Physics in Flash and AS3 are extremely hot and can be used for many, many things from game development to promotions to simulations to user interface or visualizations and even modeling natural systems. It is nice to have a port of Box2D and similar to glade capabilities with Chipmunk like Glade has.

A game and physics engine for Flash including:

  • Rigid Body Dynamics
  • Scene management
  • Line of sight
  • User Input
  • Scrolling
  • AI

Core parts of the physics solver and collision system are based on the C physics engine Chipmunk

Notes about Physaxe:

Physaxe is a 2D Rigid Body Library written in haXe. It’s been highly optimized for the Flash 9 Player, with the best optimizations available.

Physaxe is based on several existing physics engines, mainly :

  • Box2D, the reference open source physics engine
  • Glaze, an AS3 engine which is a port of Chipmunk, itself based on Box2D

Physaxe features are :

  • rigid body consisting in several shapes
  • shapes supported are circles, segments (with rounded edges) and arbitrary convex polygons
  • customizable broadphase (currently bruteforce and y-sorted list are available)
  • island resolution and sleeping (allow ~0 CPU to be spent when groups are sleeping)
  • constraint solver based on Box2D sequential impulses
  • customizable body properties, such as linear/angular friction and maximized motion

Updated list of physics engines are like this:

AS3 3D Physics Engines (Open Source)

AS3 2D Physics Engines (Open Source)

haXe 2D Physics Engines

Get your game on! It is best to get them out early and often. I need to take my own advice.

Tuesday, March 25th, 2008

I was able to download the demo and it is in the store and on Adobe’s site. The new AGEIA™ PhysX™  physics engine and some sort of updated 3D with hardware rendering is nice.

But, Director is like the Rodney Dangerfield of products at Adobe.  Everywhere you have to dig for it, it doesn’t even have updated marketing in most places, the shockwave player link is still from 2002 etc.  I wish that Adobe would support it more, open it up, allow better IDEs, integrate ES4 based Actionscript 3 or 4 into it and keep the 3d market that shockwave supports moving along.

Maybe they will give Director more love but if they don’t allow for some community input and work on the platform like Flex and Flash have thrived on, well they might just lose that piece of the market (3d gaming, hardware).

First impression is the fonts do look much better.  Unicode support is so far so good and I haven’t had a chance to dig into the AEGIS PhysX engine yet but that looks very very fun.

For instance here is a Physics Engine call that creates a rigid body terrain


//JavaScript Syntax
var objTerrain= member("PhysicsWorld").createTerrain("myterrain",terrainDesc,position,orientation,1,1,1);

Or some raycasting:


//JavaScript Syntax
var lstraycast = member("PhysicsWorld").rayCastAll (vector(10,0,0),vector(0,0,1));
for(i = 1; i < = lstraycast.count ; i++)
{
    raycstEntry = lstraycast[i];
    put("Name:" + raycstEntry[1].name);
    put"Contact Point:" & raycstEntry[2]);
    put("Contact Normal:" & raycstEntry[3]);
    put("Distance:" & raycstEntry[4]);
}

I use the Javascript source simply because it is much more usable to me. Unfortunately the docs are only partially converted to Javascript.  Lingo is pretty close to it though but it scares people off.

What Adobe needs to do is port into Flash the ability to use Shockwave3D (hardware rendering for 3d), AEGIS PhysX, would that not blow up big time or what?