Creating a grid of spheres held in place by ‘magnetic force’

Software: Away3D 4.x

eco_bach, Jr. Member
Posted: 29 December 2012 03:24 PM   Total Posts: 35

I have a static grid composed of spheres.

I want to make the spheres in the grid behave as though they were held in a force field, so a user can ‘poke a hole’ in the grid, displace the spheres but they would spring back to their original position.

This is probably simple for any experienced Away users, but haven’t used Away for a couple years and consider myself a novice.

Can anyone suggest some next steps, tips, or point me to any similar tutorials, code samples etc?

Thanks!

   

Avatar
Luca, Sr. Member
Posted: 07 February 2013 07:34 AM   Total Posts: 230   [ # 1 ]

Change direction of gravity for the object…

getRigidBody().gravity = new Vector3D( 0, 10, 0 );

when the world gravity is:

Vector3D( 0, -9.8, 0 );

this help ? smile

   

Daniel88, Newbie
Posted: 09 February 2013 03:48 AM   Total Posts: 6   [ # 2 ]

do the spheres need to interact with each other (ie bounce off each other)? If not, then using a tween engine (eg TweenLite) to return the displaced sphere back to its original position would be fine. If you want spheres to bounce off each other for a more chaotic scene, then a physics library will take away most of the hard work. But if you have too many spheres, a physics engine may be impractical due to poor fps (how many is too many depends on the engine and the settings you give it). Im not familiar with any 3D engines so cant recommend a particular one.

Vietnam travel-Vietnam holiday tours-Paloma cruise Halong

   

Avatar
Luca, Sr. Member
Posted: 09 February 2013 07:05 AM   Total Posts: 230   [ # 3 ]

But AwayPhysics are a physics library.

More precisely a C++ library “BULLET PHYSICS” converted and compiled ( the C++ compiler make SWF not EXE ) or ported, with FlashCC

Physical material property, multi threading, GPU support ( code executed on the GPU or in one of them ) ecc ecc ecc should ensure a good FPS…

Other: CITRUS ENGINE, Green Sock, and MULTI THREADING IN ACTIONSCRIPT: http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html

   

Avatar
Luca, Sr. Member
Posted: 09 February 2013 09:27 AM   Total Posts: 230   [ # 4 ]

and more ( using workers ):

http://esdot.ca/site/2012/intro-to-as3-workers-hello-world

wink

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X