Alice Community  

Go Back   Alice Community > Alice 2 > Share Worlds

Reply
 
Thread Tools Display Modes
Gravity and ballistic motion
Old
groucho
Guest
 
Status:
Posts: n/a
Default Gravity and ballistic motion - 04-21-2008, 02:09 AM

As a phyisicist, I wanted to add motion taking earth's gravity into account to Alice. Motion should be physically realistic, reasonably smooth and should incorporate free fall, general ballistic trajectories and bouncing of objects.

After much more work than originally anticipated, I came up the enclosed solution. The world "GravityDemo" shows a couple of examples of how to the methods may be used.

The relevant methods are all incorporated in a separate library object (GLib) which can be saved and imported in other worlds. The two basic methods are "freeFallGeneral" and "riseGeneral" for objects initially falling or rising up. For special cases, I've added are a couple of convenience methods. Also, there are several function (timeToPeak, timeForFall, maxHeight, maxRange) to help setting up scenes or joining motions.

The parameters of the methods are reasonably well documented in the comments. Enjoy!
Attached Files
File Type: a2w GravityDemo.a2w (1.26 MB, 893 views)
   
Reply With Quote
Well done!
Old
DickBaldwin
Guest
 
Status:
Posts: n/a
Default Well done! - 04-21-2008, 06:32 AM

Well done. Your motions are very smooth on my desktop machine and your examples should peak the interest of many students.

Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm
   
Reply With Quote
Very well done!
Old
lanceA
Guest
 
Status:
Posts: n/a
Default Very well done! - 04-21-2008, 09:04 AM

Excellent piece of programing with Alice. Congratulations on the finished product!
   
Reply With Quote
"Gravity Library"
Old
DrJim
Guest
 
Status:
Posts: n/a
Thumbs up "Gravity Library" - 04-21-2008, 08:09 PM

Very nice. I could see these being useful on a stand alone basis as a teaching aid for physics classes. It makes you wish even more for polymorphism, true class libraries and all the good stuff "coming in release 3.0."

Also are you planning on making a bounce function for a reference plane other than the ground?

For people currently wanting to use the libraries and Alice 2.0, it would be worth reviewing the thread http://www.alice.org/community/showt...ight=clipboard
which describes how to copy something from one world to another.

If you first export the library objects as .a2c files and then import them to the new world, there seem to be minimal problems with the clipboard drag and drop (a very nice feat of programming in itself). Since all of an objects methods come with it - this step also eliminates a lot of the need for copying via the clipboard.
   
Reply With Quote
Old
groucho
Guest
 
Status:
Posts: n/a
Default 04-22-2008, 02:31 AM

Thank you for the kind words. I am fascinated by the visual power of Alice and think it deserves even more attention.

Quote:
Originally Posted by DrJim View Post
Also are you planning on making a bounce function for a reference plane other than the ground?
Well, in a limited way, that's already incorporated. Objects do not automatically bounce off ground, but they bounce after having fallen for a height "fallingHeight". To make the object bounce off ground, you need to set "fallingHeight" to the height of the object above ground.

However, if the object starts above another object, simply set "fallingHeight" to the height of the falling object above the second object and it will bounce from there.

The limitation is that objects can only bounce from planes parallel to ground and that the plane must be known beforehand (i.e., there is no true collision detection).
   
Reply With Quote
Write it out
Old
dakota95
Senior Member
 
dakota95's Avatar
 
Status: Offline
Posts: 426
Join Date: Aug 2011
Location: like I would tell you. ;)
Default Write it out - 08-11-2011, 01:35 PM

Can you write what to do out? My computer won't let me view the post.
   
Reply With Quote
Old
dubastot
Senior Member
 
dubastot's Avatar
 
Status: Offline
Posts: 661
Join Date: Apr 2009
Location: Two Steps From Hell
Default 10-19-2011, 10:53 PM

Quote:
Originally Posted by dakota95 View Post
Can you write what to do out? My computer won't let me view the post.
Dude, this is from 2008... We are in 2011.


I'm a web developer/ designer now.
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.