用3ds max作高度图 灰度图 heightmaps

首先,让我们来看看建立在3D环境中地形的优势,相对于绘画手工一切。 The major issues of painting a greyscale heightmap by hand are obvious: you don't immediately know what the outcome will look like.手工画一个灰度高度图的主要问题是显而易见的:你不马上知道结果会如何。 You don't get instant feedback on what you're doing.你不会得到你在做什么即时的反馈。 You have to let your imagination do the math.你必须让你的想象做数学。 The next thing is that if you have your map available in 3D you can use it to go on generating a texture map, a shadow map and any additional maps your heart (or client) may desire.接下来的事情是,如果你有你可以在3D地图可以用它去上生成一个纹理图,阴影图以及任何你的心(或客户端)可能希望更多的地图。

With that out of the way, let's start modeling!以这种方式进行,让我们开始建模!

We'll start out by creating a simple plane from the creation panel.开始时我们将通过创建一个从简单平面的创作小组。 Just drag it out to a random size in the top viewport.只要将它以一个随机的前视口的大小。

用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?
 Since we'll use this plane to generate maps for a Terrain, we'll want it to be rectangular.由于我们将使用这个平面来生成一个地形图,我们会想它是长方形。 After you created the plane make sure your settings about match mine:在您创建了平面,确保您的设置符合您:
用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?
 

If you accidentally right-clicked before changing the settings, you can easily access the "Parameters" rollout from the "modify" tab, right next to the "create" tab.如果您不小心用鼠标点击更改设置之前,你可以很容易找到“参数表”推出的“修改”选项卡,旁边的“创建”选项卡。

The segments can be any number, really.该环节可以为任何数字,真的。 The more you use, the finer and more detailed the map will turn out to be, but it'll also strain your workstation.你用得越多,越细,更详细的地图会变成什么,但是也将应变您的工作站。 On my PC, 64 is a good trade-off between performance and quality.在我的电脑,64是一个很好的权衡性能和质量。 For this tutorial it should be enough.在本教程中应该足够。

Now right click on your newly created plane and convert it to an editable poly.现在,右键单击新创建的飞机,将其转换为可编辑多边形。

 

用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?

  

That will enable us to use a nice tool called "soft selection".这将使我们能够使用一个很好的工具,称为“软选择”。 First make sure the plane is selected, then press the "1" key on your keyboard to go into Vertex sub-object mode (the three red dots to the very left of the "selection" rollout).首先确定这平面机被选中,然后按“1”键盘上的键进入顶点子对象模式(三个红点的非常的“选择离开”推出)。 Now expand the "Soft Selection" rollout and check "use Soft Selection".现在展开“软选择”部署和检查“使用软选择”。

用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?

 

 

    Press "w" on your keyboard to switch to your move tool and create a small mountain in the right corner of your Terrain by pressing and holding the left mouse button on the desired location and then moving the mouse up.按“W对你的键盘”切换到您的移动工具,并创建一个在你的右上角小山区地形按住所需位置上的鼠标左键,然后移动鼠标了。

用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?

 

To create valleys just move the mouse down.刚刚创造的山谷向下移动鼠标。 Create a small lake to the left of your mountain.创建一个小湖到你的山了。

Now, let's take a look at all the options we have with soft selection.现在,让我们看看所有的选项看我们选择了软。 First of all, you will obviously want to create more than just mountains and lakes.首先,你当然希望不仅仅是创造更多的高山和湖泊。 Maybe a hill in the top corner of the Plane would be nice.也许在一个平面右上角山那太好了。 In the Soft Selections Rollout change Falloff to "9,0" and repeat what you did with the mountain.在软选择的推出改变压降为“9,0”,并重复你的山一样。 Notice that the area you're affecting is much smaller this time.请注意,该地区的影响是你这个时候要小得多。 

用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?

  

So what if you wanted to create a river for the lake now?所以如果你想创造一个湖泊河流吗? For that we'll use the "paint selection" option.为此,我们将使用“涂料选择”选项。 First click "paint" in the "Soft Selection" rollout.首先点击“画”中的“软选择”部署。 If for some reason it reselects your small hill, then just uncheck "lock soft selection" and try again.如果由于某种原因,你的小山丘下重新选择,那么就取消选中“锁定软选择”,然后再试一次。 Select an appropriate brush size and start painting a small river that runs into our lake.选择一个适当的笔刷大小,开始画一个小湖河流到我们的运行。 

用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?

  

Let go of the mouse button and see that the selection stays active.放开鼠标按钮,看到选择保持活跃。 If you made a mistake, you can can use "Revert" like you would use an eraser in a painting application.如果你犯了一个错误,你可以可以使用“还原”你会喜欢用画的应用橡皮擦。 Now just grab the blue "Z-Axis" of the movement Gizmo and drag it down some, like you did earlier with the lake.现在,只要拿起蓝色的“Z轴”运动的小玩意儿,将它拖到了一些,像你先前做的湖泊。 To deselect, just uncheck the "Lock soft selection" box.要取消,只是取消“锁定软选择”框。

用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?

 

 

You can play a bit with the Soft selection options at a later time.你可以设置在稍后的时间有点软选择方案。 For now this terrain will serve our purpose well enough.现在这个地形将成为我们的目的不够好。

We now need to apply a "Unwrap UVW" modifier from the modifier dropdown menu.我们现在需要修改的申请从下拉菜单中的“拆开包装UVW”修饰符。 Go to the "Modify" Tab and apply one.进入“修改”标签,并申请1。 Make sure your plane is selected and press "1" on your keyboard to go into "select face" mode.请确保您的平面被选中,按“1键盘上的”进入“选择面”模式。 The "Unwrap UVW" Modifier should get highlighted yellow.该“拆开包装UVW”修改程序应得到突出黄色。

 ## What does this terminology mean? ##这个术语是什么意思? What's UVW, what's a UVMap? 什么是UVW,什么是UVMap? Why do we need to do this? 我们为什么要这样做? Can we get explanations here? 在这里我们可以得到解释?      [ [ User : Jekteir | Jekteir ] ] 18 : 53 , 16 April 2007 ( BST ) [[用户:Jekteir | Jekteir]] 18:53,2007年 4月16日(英国夏令) 
用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?

 

    In your top viewport, drag out a large selection box and select the whole plane.在最常见的视口,拖出一大选择框并选择整个平面。 Now select "X" or "Y" (doesn't really matter which one of the two, for our purpose) under "Sub Object Params" and click "planar Map".现在选择的“X”或“Y”(不真正的问题是两者之一,因为我们的目的)根据“子对象参数”,并点击“平面地图”。

 ## Why doesn't it matter whether X or Y is selected: what is our purpose? ##为什么不是X或Y无论是选择了:我们的目的是什么?      [ [ User : Jekteir | Jekteir ] ] 18 : 53 , 16 April 2007 ( BST ) [[用户:Jekteir | Jekteir]] 18:53,2007年 4月16日(英国夏令) 

用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?
 Next open up our newly created UVMap by clicking "Edit".接下来我们打开新创建的通过点击“编辑”UVMap。 There is our plane, mapped straight from the side.还有我们的平面,直接从侧面映射。
用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?
 

In order for this to work, you need to scale the plane to match the rectangular UVmap (you can see the borders are thicker and slightly darker than the rest of the grid).在这个工作秩序,需要延展平面,以配合矩形UVmap(你可以看到边框较厚,略高于其他暗格)。 To do that grab one of the cornerpoints and drag the plane.要做到这一点的cornerpoints抓斗之一,拖动飞机。 To limit scaling to one axis, you can hold down shift .要限制扩展到一轴,你可以按住转变 。 Your new map should look something like this:您的新地图应该是这个样子:

 ## If we're building this map thingy based on the plane itself, why isn't it already on the same scale? ##如果我们本身这个建筑平面的地图物质的基础上,为什么不是它已经在同一个规模?      [ [ User : Jekteir | Jekteir ] ] 18 : 53 , 16 April 2007 ( BST ) [[用户:Jekteir | Jekteir]] 18:53,2007年 4月16日(英国夏令) 

 

用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?

  

Now open up your Material editor:现在打开你的材质编辑器:

用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?

  

and click the as-yet-unmarked button next to the grey "Diffuse" color:并点击以及还未没有标志的按钮旁边的灰色“漫”色彩:

 

用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?

 

      From the list that pops up select "Gradient" and confirm.从弹出的列表中选择“渐变”,并确认。 You are back to the material editor and you can now change the parameters of your gradient.你又回到材质编辑器,现在您可以更改您的渐变的参数。 Edit the colors so White is the topmost color, and Black is the downmost color, as seen in here:编辑颜色,因此白色是最顶层的颜色,黑色是最下面的颜色,在这里看到:

用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?

 

Once you've set that up, click the small "Go to Parent" button to leave your "Gradient" options and go back to the General Material Options.一旦你已经设置的,只要按一下小“转到父”按钮,留下您的“渐变”选项并返回到普通材料选项。 

用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?

  

In the Basic Parameters, find the small "Self-Illumination" parameters and take it up all the way to 100.在基本参数,找到小“自我启示”参数,并采取它一直到100。 This will ensure that our plane isn't affected by any additional lighting, that might impact the heightmap we want to generate.这将确保我们的平面没有受到任何额外的照明,这可能影响我们要高度图生成。 

用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?

  

Drag and drop the Material from the Editor on your plane.拖放编辑从平面上的材料。 It should turn totally white.它应该完全打开白色。

So what did we just do?因此,我们只是做了什么?

Good Question.好问题。 I'll try to explain.我会尽力解释。 I assume you all know how heightmaps work.我想你都知道如何heightmaps工作。

 ## Can we hear what we're doing as we do it, not later when we're not sure what you're ##我们能听到我们正在做什么,因为我们这样做,而不是后来当我们不知道你是什么      referring to ?指? No , I don 't know how heightmaps work, that' s why I 'm reading the number 1不,我不知道如何heightmaps工作,这就是为什么我'米阅读数1        beginners' tutorial ! 初学者教程!      [ [ User : Jekteir | Jekteir ] ] 18 : 53 , 16 April 2007 ( BST ) [[用户:Jekteir | Jekteir]] 18:53 4月16日2007(BST)的 

They are used to tell Ogre how high or low the Terrain is supposed to be at any given position.它们被用来告诉食人魔有多高或低的地形应该是在任何给定的位置。 White means high ground, Black means low ground.白色表示高地,低地黑手段。 If you click on "show Map in Viewport" in the Material Editor You may get an idea of where we're going with this.如果你对“视口显示地图”单击材质编辑器,你可以得到一个在我们这个会的想法。

 ## So you're saying Ogre interprets the pixel color of each segment of a plane in grayscale ##所以你的意思解释食人魔在灰度的像素颜色平面的每一个片段      as a measurement of depth ?作为一个深度测量的? And presumably this limits height to a certain level of accuracy这大概和限制高度,以一定程度的准确性      ( 256 steps , or whatever ) ? (256个步骤,或别的什么)? Does this eventually become a . map object or something ?这是否最终成为一个。 映射对象的东西?      [ [ User : Jekteir | Jekteir ] ] 18 : 53 , 16 April 2007 ( BST ) [[用户:Jekteir | Jekteir]] 18:53,2007年 4月16日(英国夏令) 
用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?
 

What we just did: We applied a Gradient material to the plane, projected on it straight from the Side.我们只是做什么:我们应用了渐变材料平面,预计它从侧面平直。 This will ensure that the topmost parts of our plane will receive a whiter material and vice versa for the lower parts.这将确保我们的平面最顶端的部分都会收到对方的下部一白和副材料。

 

用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?

 

Now all that is left to do is render our plane while the upper viewport is active.现在,所有剩下要做的就是使我们的平面看上活跃。 Just position the plane so you get a good view on it in the "top" viewport, then press "F9" to render.把平面放在适当的位置,以便你得到它的“顶”视窗好的视觉效果,然后按“F9键”来呈现。

Hit the Printscreen button for a lossless shot you can cut in your imaging-software of choice, or click the "save as" button and save the render.无杂色你可以在你的影像中,选择,剪切或点击软件的“另存为”按钮,保存渲染输出窗口按钮。 In both cases you'll still need to cut it up and resize it nicely.在这两种情况下,您仍然需要剪切它,并调整其大小恰好。 This last part should be applicable to all 3D packages that support unwrapping and Gradients.最后这部分应适用于所有支持散开和渐变的3D包。

                             保存的时候请存为.png或.tif格式 8位灰度图 作出来的图像不要用ps图层修改

 ## And what do we do with this top-down image to make it usable in an Ogre-based program? ##和怎么做,我们的形象与这种自上而下的方案,以使可用在食人魔的?      [ [ User : Jekteir | Jekteir ] ] 18 : 53 , 16 April 2007 ( BST ) [[用户:Jekteir | Jekteir]] 18:53,2007年 4月16日(英国夏令) 

Note: A Heightmaps resolution should always be a power of 2 (eg 256 is 2^8) plus 1, and the same length on both sides (ie 257 x 257).注:Heightmaps决议应当始终是2(如电力256是2 ^ 8)加1,并在双方(即相同长度257 x 257)。 They also have to be saved in a greyscale format.他们还必须在一个灰度格式保存。

用3ds max作高度图 heightmaps - xuedaolaozu.zhang - 你愿意吗?
 

1= 1 = 
Tip for Intermediate users:
Texporter. Don't have it? Get it Texporter。难道没有吗? 懂了 (external link) . 。 It's the "Jack of all trades" texture plugin.这是各行各业的“杰克”纹理插件。 If you have it, forget about the Gradient process above.如果你有它,忘了梯度推移以上。 Unwrap your plane in the Z axis (straight down) and open the texporter rollout.解开了(直下来),并打开texporter推出Z轴平面。 Make sure "Polygon Fill" is checked and "Edges" is not.确保“多边形填充”复选框和“边”则不是。 Now in the "Colorize by:" parameters make sure "smooth colors" is checked and select "W (Mapping depth)".现在,在“着色方式:”参数,确保“平稳颜色”复选框,并选择“宽(制图深度)”。 Now click "Pick Object" and select the plane.现在单击“选择对象”,并选择了飞机。 It should immediately give you a full heightmap in your chosen resolution.它应该立即给你一个在你选择的决议得到充分高度图。 You may have to fiddle with the Contrast of it in some image editing app to get it right.你可能与它的一些图像编辑应用程序的对比小提琴得到它的权利。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值