在Unity中试用TreePad

treepad-with-unity-2Today I have been having a lot of fun experimenting with the TreePad app for the iPad, with this app you can easily create an awesome looking tree within a short space of time. This can then be exported as an fbx file, and so seemed like an opportunity too good to turn down to see this running in Unity. So here is what I did:  今天,在iPad上使用TreePad应用程序进行实验时,我获得了很多乐趣,有了这个应用程序,您可以在很短的时间内轻松创建一棵很棒的树。 然后可以将其导出为fbx文件,因此似乎是一个很好的机会,无法拒绝看到它在Unity中运行。 所以这就是我所做的:

First thing to do is get the app which can be downloaded from the app store on your iPad, just search for TreePad. Next, launch the app and begin creating your tree, this is very simple to do, just touch, drag and release and you’ll see a branch created with leaves attached, how simple and awesome is that! Also there are various tweaks you can do to your tree but I’ll leave you to discover that for yourselves.

首先要做的就是获取可以从iPad上的应用程序商店下载的应用程序,只需搜索TreePad。 接下来,启动该应用程序并开始创建您的树,这非常简单,只需触摸,拖动和释放,您将看到一个带有附加叶子的分支,这是多么简单又棒! 另外,您还可以对树进行各种调整,但我将自己留给您发现。

Without going into too much detail about the app itself, let’s talk about getting your newly created tree into Unity and some of the steps you’ll need to take to achieve a nice looking tree.

在不过多介绍应用程序本身的情况下,让我们谈谈将新创建的树放入Unity以及实现漂亮树所需的一些步骤。

让您的树进入Unity! (Getting your tree into Unity!)

  1. treepad-with-unity-1

    In TreeApp save your created tree and tap Object manager. Tap your saved tree and notice an Export button has appeared, tap this to export your modelled tree as a .fbx file.

    在TreeApp中保存您创建的树,然后点击“ 对象管理器” 。 点击您保存的树,然后注意到出现了“ 导出”按钮,点击此按钮可将您的建模树导出为.fbx文件。

  2. Now, connect your iPad to your PC or Mac and open iTunes, choose Apps from the left menu and under file sharing select TreePad, here you’ll notice the various trees you have saved appear in TreePad documents, select the desired fbx file and click Save to, for now pick a location such as your desktop for easy access.

    现在,将iPad连接到PC或Mac,然后打开iTunes ,从左侧菜单中选择Apps ,然后在文件共享下选择TreePad ,在这里您会注意到已保存的各种树显示在TreePad文档中,选择所需的fbx文件并单击保存到 ,现在选择一个位置(例如桌面)以方便访问。

    itunes-save-to
  3. So here is where it gets really interesting. Launch Unity, and create a New Project making sure to check Unity’s very own Tree creator package to import into your new project.

    因此,这里变得非常有趣。 启动Unity,并创建一个New Project,确保检查Unity自己的Tree Creator软件包以导入到您的新项目中。

    tree-assets
  4. In Unity, Assets -> import new asset -> Find the location of your saved tree and click Import – or in your OS, drag the .fbx file to your new project’s assets folder, after a second or two you should see your tree appear in the Project window in Unity, click on your tree and in the Inspector’s FBX Importer component – change the Scale Factor from 0.01 -> 0.5 and click Apply at the bottom.

    在Unity中,资产->导入新资产->查找保存的树的位置,然后单击导入-或在您的操作系统中,将.fbx文件拖到新项目的资产文件夹中,几秒钟后,您应该会看到树出现在Unity的“ 项目”窗口中,单击树,然后在Inspector的FBX Importer组件中-将“ 比例因子”0.01-> 0.5更改,然后单击底部的“ 应用 ”。

  5. Now, in the Project window drag the tree into your scene and change it’s Transform Position to (0, 0, 0) so it’s in view of your main camera. Remember you can always center on an object by selecting it in the Hierarchy, hovering over the Scene view, pressing F and then selecting your camera and going to Game Object > Align With View (Ctrl or Command Shift – F).

    现在,在“项目”窗口中,将树拖到场景中,并将其“ 变换位置”更改为( 0,0,0 ),这样就可以在您的主摄影机上看到它了。 请记住,始终可以通过在“层次结构”中将其选中,将鼠标悬停在“场景”视图上,按F然后选择摄像机并转到“游戏对象”>“与视图对齐”(Ctrl或Command Shift – F)来始终将对象居中。

  6. You will notice your tree is looking good but to make it look really nice, we need to add the correct Shaders and Materials to make it look a bit more realistic.

    您会注意到您的树看起来不错,但是要使其看起来真的很不错,我们需要添加正确的着色器和材质以使其看起来更逼真。

    hierarchy
  7. Collapse the parent object of your tree in your Hierarchy (see above) and you will notice that it has a child object called branches, select this to show it’s properties in the Inspector, look at the Material component and here you can see the default Shader is set to Diffuse, so let’s change this to Nature > Tree Creator Bark.

    在“ 层次结构”中折叠树的父对象(请参见上文),您会注意到它有一个名为branchs的子对象,选择它以在“检查器”中显示其属性,查看“ 材质”组件,在这里您可以看到默认的着色器设置为扩散,因此我们将其更改为自然>树造物主树皮

    shader-settings
  8. The Main Color needs to be changed from the default color (brown) to white, so that we will be able to see the texture more clearly. To add a texture click Select in the first Texture selection (Base (RGB) Alpha (A)) and choose BigTree_bark_diffuse. Do the same for the Normal map but instead choose BigTree_bark_normal.

    需要将“ 主色”从默认颜色(棕色)更改为白色,以便我们能够更清晰地看到纹理。 要添加纹理,请在第一个纹理选择(基本(RGB)Alpha(A))中单击选择 ,然后选择BigTree_bark_diffuse 。 对法线贴图执行相同的操作,但选择BigTree_bark_normal

    shader-textures
  9. For the leaves it’s a similar process to what we just did for our branches, click on the leaves child object in the Hierarchy and change the Shader to Nature > Tree Creator Leaves, ensure the main color is set to white and then add the BigTree_leaves texture to the material. Once again zoom in to take a closer look, now we have nice looking leaves attached to our branches.

    对于叶子这是一个相似的过程,我们只是做了我们的分支,单击该层次结构的子对象上,改变着色自然>树造物主叶,确保主色设置为白色,然后添加BigTree_leaves质感材料。 再次放大以仔细观察,现在我们的树枝上附着了漂亮的叶子。

And that’s it, very easy and simple to get nice looking trees in just a small amount of time. Here is what mine looked like:

就是这样,非常容易且简单,仅需少量时间即可获得漂亮的树木。 这是我的样子:

650e513

Tips and Tricks!

技巧和窍门!

You may need to tweak the tilling of the texture for the leaves and branches.

您可能需要调整树叶和树枝的纹理的分耕。

If you see this warning: “Meshes may not have more than 65000 vertices at the moment: Leaves”, then your tree was made very big in the TreePad app and includes to many leaves, scale your tree down to an easier and more manageable size.

如果您看到以下警告:“当前网格的顶点可能不超过65000个,则叶子”,那么您的树在TreePad应用程序中变得非常大,并包含许多叶子,将树缩小到更容易且更易于管理的大小。

Thanks all and happy tree creating!

谢谢大家,快乐树的创造!

翻译自: https://blogs.unity3d.com/2011/04/27/experimenting-with-treepad-in-unity/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值