3D - A Stop Sign (Difficulty: 2)
-
Key Topics Covered
Introduction
In this tutorial, we’ll build a stop sign that looks like this:
Step 1 - An “Empty” Scene with 3D Axes
Please create a new project, remove the dog sprite, and add these blocks in the “Empty1” sprite. You can find the “initialize 3D scene” and the “show 3D axis” blocks in the “3D Scene” category.
As shown, the X-axis points to the right, the Y-axis points forward (into the screen), and the Z-axis points up. You can drag your mouse on the stage to rotate the camera around it:
Step 2 - Add Red Cylinder with 8 Sides
Since the stop sign has 8 side faces, we can use the “add cylinder” block to create it. The “height” should be much smaller than its diameter, since the stop sign needs to be very thin.
This is what you should get:
Step 3 - Rotate the Cylinder
One problem with the cylinder: it has a tip pointing forward, though we need one of its side faces to point forward. Therefore, we need to rotate it slightly:
To make this happen, we need to rotate the cylinder around the Z axis for about 22 degrees. You can figure this out using the direction tool:
Here is the block to be added:
In case you are curious, you can also calculate this number using a formula: each of the 8 side faces is 360/8 = 45 degrees, and half of that is 22.5 degrees.
Step 4 - Make the cylinder “stand up”
Since all stop signs are vertical, we need to rotate the cylinder again to make it stand up. Here is what it looks like in slow motion. Can you try to make it happen?
We need to rotate the cylinder around the X-axis for 90 degrees:
Step 5 - Add the White Margin
Next, please try to add a white margin like this. Can you think about how it is done?
The white margin can be a slightly larger cylinder itself. We just need to duplicate the blocks for the red cylinder and then increase its diameter. To make sure it does not cover the front and back faces of the red cylinder, we need to make it thinner by setting its height to 7:
Step 6 - Add the Word “STOP”
For our last step, we need to add the word “STOP” as a 3D text. Its width should also be 100, so that the text will fit in the cylinder’s area.
Note that when you add the text, it will be inside the cylinder, so we can’t see it. We need to move it forward along the Y-axis so it shows in front of the cylinder.
For your reference, here is the complete program:
Creative Ideas
There are many ways you can extend this project. Here are some ideas for your inspiration:
-
Other Traffic Signs: you can reuse this idea to add some other traffic signs with different words and colors.
-
Road Name: you can try to add road name signs above the stop sign, and both of them should be attached to a supporting pole:
-
-