The Artima Developer Community
Sponsored Link

Agile Buzz Forum
ElastoLab - real time physics in VW

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
ElastoLab - real time physics in VW Posted: Jul 16, 2003 10:52 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: ElastoLab - real time physics in VW
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement
ElastoLab started out as a C++ project - real time physics simulator. When Dave got going, did the UI in VW, the physics in C++. Only later did he replace the physics in Smalltalk. It was too hard to improve the algorithms in C++

His initial proof of concept tests worked out - it was fast enough on a 400 particle test. Smalltalk ended up 3.8X times slower than C++ for the physicss calculations. Profiling indicates that this is as fast as VW can go - 80% of the time is in 4 methods. So the question is, is that fast enough?

ElastoLab requires 10 frames/second. 50% calculate time, 10% display time, 40% wait time. So while it's slower, it's fast enough. The algorithm - uses 4th order Adaptive Runge Kutta differential equation solver. Hard to code, but stable - i.e., it will look better on screen.

Finding collisions - more complex than you think. Uses the Bisection algorithm to determine the collision points. Resting Contacts are also complex - it all gets into the performance with barriers and collisions. David was able to more easily implement this in Smalltalk than in C++ due to the algorithm complexity - Baraff[94]. This was one of the drivers to doing it in Smalltalk.

Tradeoff - accuracy vs. speed - use 0.01, 0.001, or 0.001 (etc)? - the more accuracy, the lesss speed. What's "good enough"? There are better methods than Bisection; David went to Smalltalk in order to allow for better algorithms that would actually yield bigger performance gains.

So far, latest release is a tad slower - but he was focused on correctness. Next - better algorithms (as above). The better algorithms have not yet been done.

Question
How much harder was the physics in C++ than Smalltalk? - the translation from C++ to Smalltalk was just transliteration, so there's no easy way to compare. The UI was much, much faster to do in ST.

Read: ElastoLab - real time physics in VW

Topic: Register to Oracle - not so fast Previous Topic   Next Topic Topic: necho thoughts (again)

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use