Difference between revisions of "Activities/Physics"

From Sugar Labs
Jump to navigation Jump to search
Line 25: Line 25:
  
 
== Tools ==
 
== Tools ==
'''Boxes''' - Rectangles of any dimension
+
'''Stop/Start'''
:Use: click (top-left corner) drag + release (bottom left corner) -- like dragging a selection box in a photo editor
+
:Allows you to stop time and start it again, so you can build structures without it collapsing while you work.
'''Circles''' - Circles of any radius
 
:click (center) drag + release (outer edge)
 
'''Triangles''' - Triangles (equilateral) of any size and initial rotation
 
:Use: click (center of base) drag + release (tip)
 
'''Polygons''' - As many sides as you would like. Draw your own N-gon.
 
:Use: '''Click''' for each point, '''to end''': right click, or left click in the circle around the original point
 
 
'''Draw'''
 
'''Draw'''
:Use: Click and hold to draw any shape you'd like!
+
:Click and hold to draw any shape you'd like!
 +
'''Triangle''' - Triangles (equilateral) of any size and initial rotation
 +
:Click (center of base) drag + release (tip)
 +
'''Polygon''' - As many sides as you would like. Draw your own N-gon.
 +
:'''Click''' for each point, '''to end''': right click, or left click in the circle around the original point
 +
'''Erase''' - Click on an object to erase it, or draw a line of destruction--erasing everything in its path!
 +
'''Motor''' - Click an object to pin and drive it with clockwise rotation
 +
:It's easiest to pause the simulation, place your object, add its motor, and resume the simulation again.
 +
'''Box''' - Rectangles of any dimension
 +
:Click (top-left corner) drag + release (bottom left corner) -- like dragging a selection box in a photo editor
 
'''Grab''' - Drag existing objects around with the mouse
 
'''Grab''' - Drag existing objects around with the mouse
'''Joint'''
+
'''Pin''' - Pin a shape to the screen, it can rotate about the pin
 +
:If you want to lock a shape in place use two or more pins to stop it rotating
 +
'''Circle''' - Circles of any radius
 +
:Click (center) drag + release (outer edge)
 +
'''Joint''' - connect two objects together with a rod
 
:Click on any object, drag to another object + release to create a distance joint
 
:Click on any object, drag to another object + release to create a distance joint
'''Erase''' - Click on an object to erase it, or draw a line of destruction--erasing everything in its path!
 
  
 
= Development =
 
= Development =

Revision as of 18:05, 1 July 2009

Description

Activity-physics-55x55.png

Physics is a physical world simulator and playground -- you can add squares, circles, triangles, or draw your own shapes, and see them come to life with forces (think gravity, Newton!), friction (scrrrrape), and inertia (ahh, slow down!).

Screenshots

Ideas to try

  • Sorting different sized balls in to two buckets, large and small (with no jams).
  • A cyclic mechanism for lifting balls from the bottom of the screen to the top, again and again.
  • Try dropping 2 different mass objects at the same time.
  • Experiment with pendulums of different lengths and masses.
  • Ping pong, can you make a device that hits a ball back and forth across the screen?
  • Try building a mechanical binary clock.
  • Convert rotation into parallel motion using pistons.
  • Experiment with touching one motorised circle against one pinned circle of various sizes.
  • Try building a rag-doll puppet and make it dance in a convincing way.
  • Use just links and circles to make a structurally sound Eiffel Tower.
  • Try building a ratchet mechanism.
  • Try building an analogue clock face where the min hand goes around 60 times for each hour.

Tools

Stop/Start

Allows you to stop time and start it again, so you can build structures without it collapsing while you work.

Draw

Click and hold to draw any shape you'd like!

Triangle - Triangles (equilateral) of any size and initial rotation

Click (center of base) drag + release (tip)

Polygon - As many sides as you would like. Draw your own N-gon.

Click for each point, to end: right click, or left click in the circle around the original point

Erase - Click on an object to erase it, or draw a line of destruction--erasing everything in its path! Motor - Click an object to pin and drive it with clockwise rotation

It's easiest to pause the simulation, place your object, add its motor, and resume the simulation again.

Box - Rectangles of any dimension

Click (top-left corner) drag + release (bottom left corner) -- like dragging a selection box in a photo editor

Grab - Drag existing objects around with the mouse Pin - Pin a shape to the screen, it can rotate about the pin

If you want to lock a shape in place use two or more pins to stop it rotating

Circle - Circles of any radius

Click (center) drag + release (outer edge)

Joint - connect two objects together with a rod

Click on any object, drag to another object + release to create a distance joint

Development

PhysicsElements.png

There are quite a few code layers to contend with. A regular Python Activity acts as a Sugar wrapper to Physics which is written using OLPCGames which itself wraps Pygame, Physics then uses Elements as a wrapper for Box2D.

Release Notes

v2

  • Migrated to Sugar Labs
  • Motor toolbar button added
  • Pin toolbar button added
  • Toolbar reworked for displaying state and keyboard accelerators
  • Stop/play toolbar button added
  • Prevented very small freehand and polygon shapes to prevent Box2d crashes

v1

  • Original created by Brian Jordan, Alex Levenson, Chris Hager

Resources