查看: 1387|回复: 0
打印 上一主题 下一主题

中英文对照Unity3D脚本参考手册:创建你的第一颗树

[复制链接]
.    

3797

主题

11

听众

5万

积分

首席设计师

Rank: 8Rank: 8

纳金币
32328
精华
41

活跃会员 优秀版主 荣誉管理 论坛元老

跳转到指定楼层
楼主
发表于 2012-10-9 17:57:00 |只看该作者 |倒序浏览
创建你的第一颗树 Building Your First Tree
We'll now walk you through the creation of your first Tree Creator Tree in Unity. First, make sure you have included the tree creator package in your project. If you don't, select Assets->Import Package..., navigate to your Unity installation folder, and open the folder named Standard Packages. Select the Tree Creator.unityPackage package to get the needed assets into your project.
现在,我们将引导您通过创建你的第一树在Unity中。首先,请确保在您的项目中有树木生成器包。如果没有,在这里,选择"Assets">"ackage...,导航到Unity的安装文件夹,并打开该文件夹命名标准软件包。选择树Creator.unityPackage,包到你的项目中得到所需要的资产。
Adding a new Tree 添加一颗新的树

To create a new Tree asset, select GameObject->Create Other->Tree.
创建一个树,选择GameObject->Create Other ->Tree.

You'll see a new Tree asset is created in your Project View, and instantiated in the currently open Scene. This new Tree is very basic with only a single branch, so let's add some character to it.
在项目视图中你会看到一个新的树资产被创建并实例化在当前打开的场景。只有一个分支,这个新的树是很基本的,所以让我们添加一些部件。
Adding Branches 添加树枝


A brand new tree in your scene 场景中一棵全新的树
Select the tree to view the Tree Creator in the Inspector. This interface provides all the tools for shaping and sculpting your trees. You will see the Tree Hierarchy with two nodes present: the Tree Root node and a single Branch Group node, which we'll call the ***nk of the tree.
选择树在Inspector中,以查看所创建的树。此介面提供的所有工具的塑造和雕刻你的树。你会看到有两个节点:树的根节点和一个单一的分支组节点,我们称之为树干树的层次结构。
In the Tree Hierarchy, select the Branch Group, which acts as the ***nk of the tree. Click on the Add Branch Group button and you'll see a new Branch Group appear connected to the Main Branch. Now you can play with the settings in the Branch Group Properties to see alterations of the branches attached to the tree ***nk.
在树的层次结构,选择分支组,作为树的树干。点击"添加"分支组"按钮,你会看到一个新分支组出现连接到主分支。现在你可以发挥分支组属性中的设置来改变附着在树干上的树枝。


Adding branches to the tree ***nk. 添加树枝的树干
After creating the branches that are attached to the ***nk, we can now add smaller twigs to the newly created branches by attaching another Branch Group node. Select the secondary Branch Group and click the Add Branch Group button again. Tweak the values of this group to create more branches that are attached to the secondary branches.
在创建连接到主干的分支,我们现在可以添加新创建的分支的小树枝附加另外的分支组节点。选择第二个分支组,然后单击"添加"分支组"按钮。这组值进行调整,以创造更多的分支机构连接到次级分支。


Adding branches to the secondary branches. 向次级分支增加分支
Now the tree's branch s***cture is in place. Our game doesn't take place in the winter time, so we should also add some Leaves to the different branches, right?
现在树的分支结构很到位。在冬天的时候,我们的游戏不会发生,所以我们也应该添加一些树叶到不同的分支,对吧?
Adding Leaves 添加树叶

We decorate our tree with leaves by adding Leaf Groups, which basically work the same as the Branch groups we've already used. Select your secondary Branch Group node and then click the Add Leaf Group button. If you're really hardcore, you can add another leaf group to the tiniest branches on the tree as well.
装饰树的叶子,加入叶组,它的基本工作原理,我们已经使用了相同的枝组。选择您的第二个分支组节点,然后单击"添加"叶组"按钮。如果你是真正的铁杆,你可以添加另一个叶组到最小的分支树。


Leaves added to the secondary and smallest branches 树叶添加在次级和小的分支上
Right now the leaves are rendered as opaque planes. This is because we want to adjust the leaves' values (size, position, rotation, etc.) before we add a material to them. Tweak the Leaf values until you find some settings you like.
现在的叶子呈现为不透明平面。这是因为我们要调整叶子值(大小,位置,旋转等)之前,我们添加一个材质给他们。叶值进行调整,直到你找到你喜欢的一些设置。
Adding Materials 添加材质

In order to make our tree realistic looking, we need to apply Materials for the branches and the leaves. Create a new Material in your project using ^Assets->Create->Material. Rename it to "My Tree Bark", and choose Nature->Tree Creator Bark^^ from the Shader drop-down. From here you can assign the Textures provided in the Tree Creator Package to the Base, Normalmap, and Gloss properties of the Bark Material. We recommend using the texture "BigTree_bark_diffuse" for the Base and Gloss properties, and "BigTree_bark_normal" for the Normalmap property.
为了使我们的树逼真,我们需要的应用的树枝和叶子的材质。在您的项目中创建一个新的Material,使用^Assets - >Create - >Material。其重命名为"My Tree Bark",并选择"Nature - >Tree Creator Bark^ ^从着色器下拉菜单中。从这里,你可以从Tree Base包中分配纹理,法线和光泽度性能的树皮Material的纹理。我们建议使用纹理"BigTree_bark_diffuse"的基础和光泽特性,和"BigTree_bark_normal"的法线属性。
Now we'll follow the same steps for creating a Leaf Material. Create a new Material and assign the shader as Nature->Tree Creator Leaves. Assign the texture slots with the leaf textures from the Tree Creator Package.
现在我们将遵循相同的步骤创建一个叶片材质。创建一个新的材质并分配着色器从Nature ->Tree Creator Leaves。与叶纹理从树建立者包分配纹理槽。


Material for the Leaves 树叶材质
When both Materials are created, we'll assign them to the different Group Nodes of the Tree. Select your Tree and click any Branch or Leaf node, then expand the Geometry section of the Branch Group Properties. You will see a Material assignment slot for the type of node you've selected. Assign the relevant Material you created and view the results.
当创建两种材质,我们将它们分配给不同的组树节点。选择你的树,单击任一分支或叶节点,然后展开几何形状部分的分支属性。你所选择的节点的类型你会看到一个Material分配插槽。指定创建相关Material并查看结果。


Setting the leaves material 设置树叶材质
To finish off the tree, assign your Materials to all the Branch and Leaf Group nodes in the Tree. Now you're ready to put your first tree into a game!
要完成的树,所有的枝和叶组树中的节点分配给您的材质。现在你可以把你的第一棵树变成一种游戏!


Tree with materials on leaves and branches. 树叶与树枝的材质
Hints. 提示

•Creating trees is a trial and error process.

创建树是一个尝试与错误过程。

•Don't create too many leaves/branches as this can affect the performance of your game.

不要创建太多树叶/树枝因为这会影响你的游戏的性能。

•Check the alpha maps guide for creating custom leaves.

检查alpha贴图指南创建自定义树叶。



【本文来源网络】
分享到: QQ好友和群QQ好友和群 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
转播转播0 分享淘帖0 收藏收藏0 支持支持0 反对反对0
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

关闭

站长推荐上一条 /1 下一条

手机版|纳金网 ( 闽ICP备08008928号

GMT+8, 2024-5-6 04:59 , Processed in 0.089295 second(s), 33 queries .

Powered by Discuz!-创意设计 X2.5

© 2008-2019 Narkii Inc.

回顶部