Activities/Physics

From Sugar Labs

Jump to: navigation, search

Contents


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

A motor drives the centre cross shape, while the outer edges are pinned to stop the blender breaking.
One motor is used to drive a circle connected via a belt to another pinned wheel that bounces a weight to make a puppet dance.
More puppet dancing
Running dog using two motors
Using a motor on a circle to drive a piston that slowly releases balls one by one
Motor driven earthquake simulator
Example illustrating transverse wave propagation.
Example illustrating longitudinal wave propagation.

Ideas to try

Tools

Physics-toolbar.png

Stop/Start: allows you to stop time and start it again, allowing you to build constructions without them collapsing while you work. Note that since version 5 you can now use the Grab tool while time is stopped to easily re-arrange the position of objects. <Ctrl>+space

Draw: click and hold to draw any shape you'd like! <Ctrl+D>

Circle: circles of any radius. Click (center) drag and release (outer edge). <Ctrl+C>

Triangle: triangles (equilateral) of any size and initial rotation. Click (center of base) drag and release. <Ctrl+T>

Box: rectangles of any dimension. Click (corner) drag + release (opposite corner). <Ctrl+B>

Polygon: as many sides as you would like. Draw your own N-gon. Click, drag and release for each point, to end return to the start point. <Ctrl+P>

Grab: drag existing objects around with the mouse. <Ctrl+G>

Motor: click an object to pin and drive it with clockwise rotation. It is easiest to stop the simulation, place your object, add its motor, and resume the simulation again. <Ctrl+M>

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. <Ctrl+O>

Joint: connect two objects together with a rod. Click on any object, drag to another object and release to create the joint (each end of joint allows rotation). <Ctrl+J>

Erase: click on an object to erase it, or click and hold to draw a line of destruction--erasing everything in its path! <Ctrl+E>

Hints and tips: Single clicking (no drag) with the circle, triangle or box tool, will add a default sized shape. Once you have used a shape tool, it remembers the last shape you made with it, a single click will add a clone of that last shape.

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.

Video

Please do post videos with feedback, talking while you're trying something for the first time is particularly insightful as it can highlight those initial expectations for user interface behaviour. Bonus points to Dennis for being brave enough to be part of the first wave!

UI feedback Video unfortunately there's a seg fault at the end, ticket from Dennis is #1194.

Sugar at the Boston Museum, for more information see Bill Kerr's blog.

Release Notes

v5

v4

v3

user notes

I really struggle to get any of the motor actions to work. Can you post some videos of your own successes? It's hard to build curriculum when you don't know how something is supposed to work.

v2

v1

Resources

Personal tools
Namespaces
Variants
Actions
Sugar
Projects
Teams
Local Labs
Using the Wiki
Google translations