3D Introduction and Tutorial of Scratch

Chapter 1 Why Is 3D Difficult?

1.1 Where is the difficulty of 3D?

The reason why 3D makes us feel difficult is because the Scratch software only has two coordinate axes: X axis and Y axis.

2D coordinate system

2D coordinate system

3D has three coordinate axes:

3D coordinate system

3D coordinate system

what to do? It's very simple, wouldn't it be good to "create" one yourself?

So, there is "pseudo 3D".

1.2 "What is pseudo-3D?

To understand "pseudo 3D", you must understand 2D and 3D.

2-dimensional, both plane. Three-dimensional, both three-dimensional. Simply put, many 2-dimensional planes can form a 3-dimensional figure, and a 3-dimensional figure can be divided into many 2-dimensional planes. Therefore, "pseudo 3D" is produced through such a "stacking" method.

It's easy, isn't it?

1.3 How to get "pseudo 3D"?

I believe that by this point, many students are already eager to try, so...

Go to the tutorial!

The first step is to make a graph.

1.1

1.1

1.2

1.2

The picture above was drawn by me, and you can use it as you like.

The second step is to use clones to achieve "stacking".

Let me tell you here, it doesn’t matter for students who have not used cloning, just do it.

2.1

2.1

There is a cat here because I added a building block style, if you like it, you can find it in the expansion.

Okay, without further ado, let's continue.

Next, we proceed to the most important step - "stacking".

2.2

2.2

Look carefully, does it smell like that?

2.2 Renderings

2.2 Renderings

The third step is overall optimization.

Through careful observation, we found some problems: there are pixels on the edge, which cannot be displayed at one time.

3.1

3.1

Here is the solution:

3.2

3.2

NOTE: Be sure to check this box!

3.3

3.3

finished? congratulations:

Mastered the production method of "pseudo 3D"!

However, at this time, someone will ask:

You can't do this either!

It doesn't matter, I still have "True 3D".

The second "True 3D"

This chapter has a lot of dry goods, so read it carefully.

Without further ado, let's go to the tutorial!

The first step is to define building blocks.

2.1.1

2.1.1

2.1.2

2.1.2

The second step, procedure 1.

2.2.1

2.2.1

2.2.2

2.2.2

The third step, procedure 2.

2.2.3

2.2.3

The fourth step, procedure 3.

2.2.4

2.2.4

The fifth step is to hide variables.

2.2.5

2.2.5

Now, let's test it out.

Effect

Effect

Title:

3D engine (pure code)

Finally, thank you for reading this article, I hope it will be helpful to you.

Guess you like

Origin blog.csdn.net/leyang0910/article/details/132059358