Table of Contents

Pen up

Description

After execution, the sprite moves on the stage and does not draw lines.

Example

Learn how to create your own interactive drawing experience using PictoBlox’s Human Pose Detection extension. In this project, you will control a pencil using your finger movements and draw in the air, with your motion reflected on the screen in real time.

Introduction 

In today’s world of interactive technology, creating engaging and intuitive experiences has become easier than ever. This project demonstrates how we can transform simple hand movements into digital art using PictoBlox and its powerful Human Pose Detection feature.

By leveraging computer vision, we can track the movement of our fingers in real time and use them as a virtual drawing tool—turning the air around us into a canvas. Without the need for physical contact or traditional input devices, this project offers a fun, innovative way to explore creativity and technology together.

 

Prerequisites

To make the project all you need is 

  • A laptop or a computer with a camera,
  • The latest version of PictoBlox downloaded
  • Good Internet connection.

Setting up the Project

Let’s begin by adding the human body detection and pen extension. 

  1. Open PictoBlox.
  2. Click on the Add extension buttons.
  3. Choose the Human Pose Detection extension and wait for a little while till the models get loaded.

You may see that human body detection and pen blocks are added into the block palettes.

Setting Up the Stage

Now, let’s add a new Pencil sprite to draw.

  1. Click on the ‘choose a sprite’ button and select a pencil sprite from the library.

  1. Right-click on Tobi and choose delete from the dropdown to delete Tobi’s sprite.

  1. Add a backdrop using Choose a backdrop > Search & Select Neon Tunnel backdrop.

Making the Pencil follow the Finger

Let’s begin to write the script.

  1. Select the Pencil sprite.
  2. Go to the Events palette and drag the ‘Green Flag’ block drop into your coding area.
  3. Add the ‘Pen Clear’ block from the Pen palette.
  4. Drag and drop the ‘Pen down’ block fromPen palette.
  5. Now set the pen colour; for that, drag and drop the ‘Pen Color’ block into the scripting area. Change the color to red.

  1. As we will be drawing in air and the drawings will be traced on the screen, we need to add the ‘Camera Switch’ block from the Human Pose Detection Extension.
  2. Add the ‘Repeat forever‘ block from the Control palette to run the script continuously.
  3. Now as we need the details of the hand in real-time, inside the repeat block, add the ‘Analyse hand’ block from the Human Pose Detection extension.
  4. Add ‘Move with hand’ block from the Human Pose Detection extension. Click the dropdown to change to the index finger. With this, the script to trace our finger is completed.

Output 

Click the Green Flag from the bottom right corner to run a code block.

Conclusion

Now you’re all set to make your surroundings your canvas with PictoBlox’s Human Pose Detection Extension.

Have fun!

Read More
In this project, you will learn how to bridge the gap between physical movement and digital art. By leveraging PictoBlox’s Human Body Detection (or Face Detection) extension, you’ll program a virtual pencil to trace a perfect square on your screen.

Introduction 

Have you ever wanted to draw just by moving your body? This project introduces you to the world of computer vision. We will be using “Junior Blocks” to create a script where a Pencil sprite reacts to the camera.

While the image suggests controlling a bird with your nose, we are going to take those same AI concepts—tracking a specific point on your face or hand—to command our Pencil sprite to move in a precise square pattern. It’s a perfect blend of geometry and artificial intelligence!

Prerequisites

To make the project all you need is 

  • A laptop or a computer with a camera,
  • The latest version of PictoBlox downloaded
  • Good Internet connection.

Setting Up the Stage

Now, let’s add a new Pencil sprite to draw.

  1. Click on the ‘choose a sprite’ button and select a pencil sprite from the library.

  1. Right-click on Tobi and choose delete from the dropdown to delete Tobi’s sprite.

  1. Add a backdrop using Choose a backdrop > Search & Select Light backdrop.

Making the Pencil follow the Finger

Let’s begin to write the script.

  1. Select the Pencil sprite.
  2. Go to the Events palette and drag the Green Flag block drop into your coding area.
  3. Add the Pen Clear block from the Pen extension.
  4. Now set the pen colour; for that, drag and drop the pen colour block into the scripting area. 

  1. Drag and drop the Pen down block from the pen extension.
  2. Add the Forward Block from Motion Palette and change the count to 5.
  3. Add the Down Block from Motion Palette and change the count to 5.
  4. Add the Backward Block from Motion Palette and change the count to 5.
  5. Add the Up Block from Motion Palette and change the count to 5.
  6. Finally drag and drop the Pen Up block from the pen extension.

Output

Read More
All articles loaded
No more articles to load