ElastoLab A Physics Playground for Kids

1 / 25
About This Presentation
Title:

ElastoLab A Physics Playground for Kids

Description:

Started as a Master's thesis 1990 Smalltalk. Re-wrote in C (1993) ... Runtime Packager used for stripping image. ResHacker used to create one executable. ... – PowerPoint PPT presentation

Number of Views:54
Avg rating:3.0/5.0

less

Transcript and Presenter's Notes

Title: ElastoLab A Physics Playground for Kids


1
ElastoLabA Physics Playground for Kids
  • David Buck
  • Simberon Inc.
  • www.simberon.com

2
History
  • Started as a Masters thesis 1990 Smalltalk
  • Re-wrote in C (1993)
  • Close to release (1996)
  • Rewrote in Smalltalk (1998)
  • Released for sale (2001)
  • Physics re-written in Smalltalk (2002)

3
Demo
4
Physics
  • How do you simulate physics?
  • Easy
  • Calculate the forces on each particle.
  • a F/m
  • Add a bit of the acceleration to the velocity
  • Add a bit of the velocity to the position
  • Repeat
  • Eulers method

5
Problem
  • Falling particles work great
  • Springs explode when the strength gets too high

6
Solution Runge Kutta
  • Calculate forces 4 times, combine results.

7
Better
  • But really strong springs still explode.
  • Solution Adaptive Runge Kutta
  • Adapt step size according to error between single
    and double steps.

8
Barriers
  • Easy you just reflect the particles position
    and velocity by the barrier

9
Umm Problem
  • Springs explode and rigid bodies dont spin.
  • Solution Step forward to the time of collision
    then apply an impulse to the particle

10
What time is the collision?
  • How do we know what time the particle hit?
  • What if many particles hit around the same time
    which hit first?

11
Solution
  • Use Bisection Method to narrow down time of first
    collision.

12
Resting Contact?
  • What happens if the particle is sitting on the
    barrier? Collision time is almost zero.

13
Dynamic Constraints
  • Detect resting contacts and add a dynamic
    constraint force.
  • The constraint force is a force just strong
    enough to prevent the particle from penetrating
    the barrier.

Constraint Force
Net Force
14
Multiple resting contacts
  • What happens if a particle is in resting contact
    with two or more barriers?

15
Solution
  • Use Quadratic Programming or Baraff 94
  • ltunclegt
  • Ok, just stop the particle and hope nobody
    notices.

16
User Interface
  • Every physics object has a corresponding
    Display object.
  • A Camera defines the transformation from world
    to display and back.
  • Clipping implemented for lines and polygons.

17
Custom Widgets
  • Custom widgets enhance the appearance of
    ElastoLab.

18
Interfacing to Sound
  • Smalltalk calls a C DLL I wrote
  • The C DLL calls the COM interface to access the
    DirectX 8 sound facilities.

19
Help Facilities
  • Three kinds of help
  • Fly by help
  • Help mode Windows help files
  • Guided tour

20
Guided Tour
21
Source Code Management
  • For C, I just made copies of the source files.
  • Smalltalk StORE using a Postgres database.
  • ElastoLab consists of 2 bundles, 15 packages, 300
    classes.

22
Making it Fast
  • Displaying bitmaps works much faster if you use
    convertForGraphicsDevice and cache the result.
  • High level optimizations better than low level
    optimizations

23
Packaging
  • Runtime Packager used for stripping image.
  • ResHacker used to create one executable.
  • InstallShield Express used to install.

24
Message Board
  • Online message board runs on Web Toolkit.
  • SSL pages link to Smalltalk servlets
  • Small app (4 classes)

25
Wrap Up
  • Smalltalk is quite fast enough to handle
    ElastoLab.
  • Flexibility of Smalltalk is a big advantage.
  • Packaging can create a single executable that
    fits into the Windows environment.
  • SSP pages and Smalltalk servlets can be used to
    build community with a message board.
Write a Comment
User Comments (0)