Draw in the Air Using Human Body Detection Extension

Air Drawing Project Thumbnail
About This Project

Learn to draw in the air with your finger using PictoBlox AI’s human body detection feature!

Project Info

Introduction

Art is in the AIR; literally. How? With PictoBlox’s human body detection ability! Learn to draw your favorite pictures in the air using the tip of your finger and the blocks in Human Body Detection Extension in PictoBlox and trace it on your computer screen. No more worrying about finished sketchbooks or pencils. All you need is your finger and the world becomes your canvas! 😉

Ready to give this unique form of drawing a try?

Let’s get started!

Building Guide

Step 1: Prerequisites

To make the project all you need is 

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

You can download PictoBlox from here:

Step 2: Setting up the Project

Let’s begin by adding the Human Body Detection and Pen Extension. 

  1. Open PictoBlox.
  2. Click on Board and select evive.select evive as board
  3. Click on the Add extension buttons.
  4. You need to keep two things in mind while working with this extension:
    1. That your computer is connected to the internet.
    2. You did Log in to your PictoBlox account to use it.
  5. Choose the Human Body Detection extension and wait for a little while till the models get loaded.Human Body Detection Extension
  6. Now to draw on the screen, we need to add the Pen extension. Now click on the Add extension button again.
  7. And choose Pen extension.pen extention

You may see that Human Body Detection and pen blocks are added into the block palettes.

Step 3: Setting Up the Stage

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

  1. Click on choose a sprite button and select a pencil sprite from the library. pencil sprite
  2. Right-click on Tobi and choose delete from the dropdown to delete Tobi’s sprite.delete tobi1
  3. We will need to make a few changes in the costume of the Pencil  Sprite. Select the Costume Palette to edit the costume.Costume Palette
  4. Next, drag the pencil into the costume area, such that the tip of the pencil should be on the center dot.
  5. Next, we need to make 3 additional sprites.
    1. Pen Up: to stop drawing on the screen
    2. Pen Down: to draw on the screen
    3. Erase All: to clear the screen
  6. Click on Choose A Sprite button and select the Paint option. Use the rectangle tool to draw background and Text tool to display the message.Pen Down sprite
  7. Similarly, make the other two sprites which are Pen Down and Erase All.pen up sprite erase all sprite
  8. Once the sprites are made, let’s arrange them onto the stage so that we can get sufficient space to draw. To align them in a straight line, you can keep the value of y-coordinate the same.

Now we need to move on with the script.

Step 4: Making the Pencil follow the Finger

Let’s begin to write the script.

  1. Select the Pencil sprite.
  2. Drag and drop a when flag clicked hat block into the scripting area to execute the program whenever the green flag is clicked.
  3. As we will be drawing in air and the drawings will be traced on the screen, we need to turn the camera on, thus snap a turn on video on stage with 0% transparency block from the Human Body Detection palette.Gesture Controlled Space Batlle Script
  4. Add a forever block from the Control palette to run the script continuously.
  5. Now as we need the details of the hand in real-time we will be using analyse image for hand from camera block from the Human Body Detection palette.analyse image from camera
  6. Next, we need to check whether our hand is detected or not. Thus, place an if block from the Controls palette.if hand detected
  7. We will be using the tip of the index finger to draw. Thus, we need the tip of the pencil to follow the tip of our index finger. We will use go to x() y() block from the motion palette.
  8. Next, place the x position of top of thumb block from the human body detection palette into the x input of the go to x() y() block. From the last dropdown, select index finger.position of finger block
  9. Duplicate this block and place it into the y input, select y from the first dropdown.moving the pencil to index finger

With this, the script to trace our finger is completed.tracing the fingers movement

Next, we need to write the scripts to start drawing, stop drawing, and erase the drawing i.e. we will be activating the buttons that we’ve created one by one.

Step 5: Scripts to Activate the Buttons

Next, we need to start drawing as soon as the button a.k.a the Pen Down Sprite is clicked.

  1. Choose the Pen Down sprite.
  2. Drag and drop when this sprite clicked hat block from the Events palette.
  3. Next, place a broadcast message block from the events palette and write Pen Down from the into the message.script to start drawing1
  4. Next, we need to perform some actions according to the button clicked i.e. the pencil should start drawing. Thus, let’s go back to the pencil sprite.
  5. Place when I receive block from the events palette and select pen down from the dropdown.
  6. Now, to make the pencil draw, drag and drop the pen down block from the pen palette below it.

Thus, we have assigned action to one button.

Step 6: Scripts to Activate the Buttons

Script to Start Drawing

Next, we need to start drawing as soon as the button a.k.a the Pen Down Sprite is clicked.

  1. Choose the Pen Down sprite.
  2. Drag and drop when this sprite clicked hat block from the Events palette.
  3. Next, place a broadcast message block from the events palette and write Pen Down from the into the message.script to start drawing1
  4. Next, we need to perform some actions according to the button clicked i.e. the pencil should start drawing. Thus, let’s go back to the pencil sprite.
  5. Place when I receive block from the events palette and select pen down from the dropdown.
  6. Now, to make the pencil draw, drag and drop the pen down block from the pen palette below it.

Thus, we have assigned action to one button.

Script to Stop Drawing

Next, we need to stop drawing as soon as the button a.k.a the Pen Up Sprite is clicked.

Repeat the above step 1 to step 3 and make the respective changes and the script will look like this.

script to stop drawing1

To assign actions to the button, repeat step 4 to step 6 and make the following changes. Replace the pen down block with the pen up block.script to stop drawing

Script to Erase the Drawing

Finally, we need to erase the drawing as soon as the button a.k.a the Erase All Sprite is clicked.

Repeat the above step 1 to step 3 and make the respective changes and the script will look like this.

script to erase drawing1

To assign actions to the button, repeat step 4 to step 6 and make the following changes. Replace the pen down block with the erase all block.

script to erase drawing

Thus, our script is complete.

Step 7: Conclusions

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

Have fun!

Code

DescriptionDownload Code
Draw in the Air with Human Body DetectionDownload
Share this Project
Share on facebook
Facebook
Share on twitter
Twitter
Share on google
Google+
Share on pinterest
Pinterest
Share on reddit
Reddit
Share on print
Print
Featured Projects
All articles loaded
No more articles to load