TINKER PiEDESIGN IN INDIA
Advanced

Bouncing Ball PhysicsSimulate gravity: a ball falls, bounces and slowly loses energy.

You write a short TinkerPie Python program by following the Code guide in the workspace, then press Run. The sample program and step-by-step guide are always there to help.

What you will learn

  • Speed and gravity
  • Updating variables every step
  • Simple physics simulation

What you need

  • Any laptop, tablet or phone. For VR: a phone and a phone VR viewer (TinkerPie VR viewer or any phone headset)

Steps

  1. Type the program from the Code guide, then press Run.
  2. Watch the ball bounce lower each time.
  3. Change gravity and run it again.

How it works

Each step, gravity makes the speed a little more negative (falling faster). When the ball reaches the floor, the speed flips to go up, but keeps only 80% of it: that lost energy is why real balls stop bouncing.

Coding concepts

Simulation
A program that copies how the real world behaves.
Negative speed
Below zero means moving down.

Expected output

A ball dropping from high up, bouncing several times and coming to rest, with its height shown on screen.

Challenges

  • Try gravity on the Moon (much smaller).
  • Keep 95% of the speed instead of 80%.
  • Add a second ball that starts higher.

More AR/VR projects

Basic10 minAR / VR, Computer Vision

AR Sunglasses

Put cool AR sunglasses on every face in the camera, like a photo filter app.

  • What augmented reality (AR) is
  • Placing pictures on detected faces
  • Filters you see in apps
Hardware: Laptop, tablet or phone cameraAI Cube: Virtual Cube only · Virtual Cube: laptop or phone camera
Basic15 minAR / VR, Gesture Recognition

AR Filter Switcher

Change your AR face filter by holding up 1, 2, 3 or 4 fingers.

  • Two AIs together: face and hand
  • Choosing with if / elif
  • Interactive AR
Hardware: Laptop, tablet or phone cameraAI Cube: Virtual Cube only · Virtual Cube: laptop or phone camera
Intermediate20 minAR / VR, Gesture Recognition

AR Air Drawing

Draw glowing lines in the air with your fingertip; open your hand to wipe the picture.

  • Fingertip tracking
  • Drawing with points
  • Pen up / pen down logic
Hardware: Laptop, tablet or phone cameraAI Cube: Virtual Cube only · Virtual Cube: laptop or phone camera