Categories: Unity, C #, VS2015
Date Created: 2016-04-02
First, the basic concept
Unity already has some basic 3D objects built into it, and with these built-in 3D objects you can directly build a variety of 3D models (of course, complex three-dimensional models need to be done with professional modeling software).
The Unity 5.3.4 built-in 3D objects are:
Cube: Cube
Sphere: Sphere
Capsule: Capsule body.
Cylinder: Cylinder.
Plane: Flat.
Quad: Four squares.
Ragdoll: Ragdoll system.
Terrain: topography.
Tree: Trees.
Wind Zone: Winds.
3D text: Writing.
Ii. Basic usage of cube
The following is an example of cube, which illustrates the basic usage of creating a 3D model directly.
How to create a cube (cube): "Gameobject", "3D Object", "Cube":
After you create a cube object, you see the name of the object in the hierarchy view.
To distinguish which object is, you can also click the object you just created in the hierarchy view to modify its name, for example, to change the object you just created to "Cube01".
By pressing the F shortcut (centered), you can see the CUBE01 original shape in the scene:
is to continue creating the CUBE02 (do not tick Cube01 in the viewer to make it invisible, then select Cube02, then press R to enter zoom mode, and then drag the left mouse button to zoom x, Y, z direction respectively):
Is CUBE01, Cube02 are visible, and Cube01 change shape and position after the effect. Still using Q, W, E, R shortcut keys (hand, pan, rotate, zoom) and drag the mouse to achieve:
Then create a Cube03:
Also select Cube01, Cube02, CUBE03, and then use the "Duplicate" copy (shortcut key: ctrl+d):
The following is the result of the replication:
Rotate it a bit more:
With these steps, you can see that the various shapes are created using only cube.
Delete the object you just copied (just to let you see how to copy it).
These three cube maps are given below.
Drag-and-drop Grass01 to CUBE01, drag brick_d to Cube02 and Cube03, and set the X value in the Cube03 property of the CUBE02 (or Tiling) map to 15, as shown in:
This has the following effect:
The way to create other basic models with built-in 3D objects is similar to the approach described here to create various 3D models using cube.
If these basic models are combined together, three-dimensional models of various shapes can be constructed.
Third, the description
While the previous section describes how to create 3D objects directly in unity, there is a big drawback to doing this directly: Because each 3D object is a separate component, and its nature is similar, creating so many independent objects each time takes up memory space and renders less performance. In other words, this approach is not a good idea, so what should be done in practice? This is the role of the preset (Prefab) that will be described in the next section.
"Unity" 3.1 creates three-dimensional models with built-in 3D objects