Game Development Reference
In-Depth Information
Figure 2-60. The Corn Stalk painted as a Tree
7.
Click Play, and switch back to the Scene view to see your new corn field.
The last issue you may come across is incorrect transforms on import. Depending on the application your
plant was created in, its scale and orientation may be incorrect. Unity does a very good job with regular
scene objects by interpreting their transforms correctly after import. The two exceptions are when the
objects are used in the terrain and when they are used in Mecanim, Unity's character-animation system.
When authoring in 3ds Max, for instance, where Z is up in the world, you may have to use what is
commonly referred to in the 3ds Max community as the “box trick” to collapse the transform matrix in the
correct orientation.
In Figure 2-61 , A, a cone is created in the top viewport in 3ds Max and exported as an fbx file. With
the coordinate system set to Local, you can see that its up axis is the Z axis. In Figure 2-61 , B, a
box is created in the front viewport so that its local Y axis is pointing up. In Figure 2-61 , C, the box
has been collapsed to a mesh object, the cone has been attached to it, and the box's geometry has
been deleted from the resulting object. The final object is left with the cone's geometry and the box's
transform matrix, where Y is pointing up.
Figure 2-61. The cone with its native orientation (left), a box created so that its up direction is Y (B), and the cone attached to the
box with the box's geometry removed and the Y up orientation retained (C)
 
Search WWH ::




Custom Search