游戏邦在:
杂志专栏:
gamerboom.com订阅到鲜果订阅到抓虾google reader订阅到有道订阅到QQ邮箱订阅到帮看

使用Blender创建3D模型的快捷操作步骤

发布时间:2011-06-15 23:53:06 Tags:,,

引言

你也许能够在脑海中形成了一个3D画面,你也知道如何去编写3D场景,如何安排场景里的各种关联和情节发展,但是对于3D模型的设计你却常常无从下手。到底需要投入多少资产才能制作出让观众眼前一亮的3D画面?可以说图像是3D场景中最重要的组成因素。但是不幸的是,很多开发者擅长编码,却不知如何创建资产。本文的主旨就是为各位解答这个问题。

Blender是一款用于创建三维电脑图像的自由软件。

一些制作精密的图形框架或者类库都有一些目标文件格式(.obj)或者音频文件格式(.wav)以及其它开放式数据标准格式。经过比较,我最喜欢libgdx(游戏邦注:一款支持2D与3D游戏开发的游戏类库),它能让你能够轻松通过3行代码导入blender输出的.obj模型。

这篇新手教程是我花了几个小时上网搜索,并贴着电脑研究Blender用户界面而催生出的结果。我将通过以下步骤教您如何省时省力地使用blender创建,纹理化和输出可导入libgdx或其它图形框架的模式。

前提条件

1.Blender 2.5版本

2.稍微了解Blender的使用界面,至少要知道什么是“Hello World”(游戏邦注:这是每一种计算机编程语言中最基本、最简单的程序,也是初学者所编写的第一个程序)

3.知道什么是libgdx mesh(网格或者说三维网格形式的高级图元)和texture(纹理)。

4.20分钟时间。

打开Blender,点击目标窗口,按空格键。

输入“ico sphere”(共有100种方法能够添加ico sphere,而这只是其中的一种),并点击“add”。

第一步,创建图形(from nfshost.com)

第一步,创建图形(from nfshost.com)

在目标模型菜单旁边的“Viewport Shading”菜单中选择“Wireframe”。

Viewport菜单(from nfshost.com)

Viewport菜单(from nfshost.com)

点击左边的“Object Mode”并选择编辑模型。

输入字母“a”以取消对目标物体的选择(用“a”选择或取消选择所有目标物体)。

输入字母“b”激活选中的目标图像,并确定wireframed mesh的分割线。(你可以使用鼠标中间的按钮控制并调整出最适合的图像)。

点击页面边缘按钮,以选择图像的边缘范围,而非顶点范围。

Edge菜单显示在红线框选的圆圈中(from mobteklabs.com)

Edge菜单显示在红线框选的圆圈中(from mobteklabs.com)

当你选择了分割线的边缘范围时可以同时按压键盘的“ctrl”和“e”键以形成边缘范围图像。

选择“Mark Seam”,而事实上在这里出现了很多交界处。这些交接看起来就像texture的折合,而这点作用在后面的流程中将会大有用处。

通过选择左下边缘的3个条纹以分割屏幕显示画面,单击并拖动这些长条,创建出2个窗口。

创建出2个窗口(from nfshost.com)

创建出2个窗口(from nfshost.com)

重新回到目标图像的页面上,确保你所要呈现的目标图像足够显眼,然后在UV mapping菜单栏中上打出字母“u”,选择“Unwrap”并下载以下的图像。

下载这张图片(from nfshost.com)

下载这张图片(from nfshost.com)

在其它的texture映射屏幕上,选择“Image”菜单,并点击“open image”以对之前所下载的图像进行操作。

选择Image菜单,然后打开图像(from nfshost.com)

选择Image菜单,然后打开图像(from nfshost.com)

在texture映射屏幕上,打出字母“a”以选择所有图像,打出字母“r”对图像做出旋转。最后,你便能够使用texture操纵图像了。

为操纵这个wireframe mesh mapping,你得选择边缘、顶点或整个部分的线框(输入“b”意为框选)。现在你可以使用s,r,g按比例旋转并抓取自己的选择。可以试试尽量使用wireframe mesh覆盖整个地球。

无需考虑对称性,选中合适的图像即可(from nfshost.com)

无需考虑对称性,选中合适的图像即可(from nfshost.com)

现在你可以去目标图像页面上,点击“Viewport shading”(也就是在你之前选择“wireframe”的目录中)选择“Textured”,而便能够看到自己做的texture了!能够做到这一步就说明你几乎已经踏入成功的大门了。必要的话也可以多试几次。

在屏幕的左上方你将看到一个项目菜单栏,你便可以选择“Materials”页面(详见以下截图)。

点击New按钮(from nfshost.com)

点击New按钮(from nfshost.com)

点击“New”。

点击上面菜单栏的下一个图标,以打开texture菜单栏。

点击“New”。

点击Open以对原来保存的图像进行操作(from nfshost.com)

点击Open以对原来保存的图像进行操作(from nfshost.com)

点击“open”以操纵你之前保存的图像。

点击标签列表下的“Mapping”。

使用坐标轴选择UV。

现在你便能够输出.obj文件并将其导入你所喜欢的图形框架中。而libgdx可以说是你最好的选择。注意:要确保你使用的texture与其他libgdx图像资产一样保存在你的“数据”目录中!(本文为游戏邦/gamerboom.com编译,如需转载请联系:游戏邦

How to create 3d models in Blender – for libgdx, Android, iPhone etc.

by cybertron

Intro:

You have a beautiful 3d scene pictured in your mind. You think you have a pretty good idea of how to code it, the interactions, the flow, but what about the models?

What about the assets that are going to ‘Wow’ your users when they see them? Arguably the most important part of a 3d scene, the models are the stars of the show.

Unfortunately, a lot of developers can code but don’t know how to create assets. This blog post is meant to introduce you to the answer.

Developer, this is Blender, Blender this is developer.

Any decent graphics framework or library will have a .obj or.wav or other open data standard that they can load models from. My chosen favorite libgdx from a comparison I did earlier. Libgdx easily lets you load blender exported .obj models in about 3 lines of code.

This tutorial is the fruits of a couple of hours of googling and mashing my face against the keyboard/Blender UI (REALLY takes some getting used to) Also, this blog is about doing a lot with little time, so I hope you appreciate getting straight to the point.

Scope:

This tutorial will guide you through the steps required to create, texturize and export a model from blender that can be loaded with libgdx or other frameworks.

The Goods:

Prereqs:

Blender

Light knowledge of using blender interface, at least the Hello World

A little prior knowledge of libgdx meshes and textures

20 minutes.

Fire up Blender, Click in object window, press spacebar.

Type ‘add ico sphere’ (100 ways to add an ico sphere, this is just one), click to add.

Select the ‘Viewport Shading’ menu next to the object mode menu then select ‘Wireframe’.

Click on ‘Object Mode’ to the left of where you clicked for the wire mesh and select edit mode.

Type ‘a’ to unselect the object. (Try toggling ‘a’ to select and deselect all)

Type ‘b’ to activate block selecting mode and select the equator of the wireframed mesh. (Note you can use middle mouse button to look around and get a better look)

Click the edge button to select the edges, not vertices.

While equator edges are selected press ‘ctrl’ + ‘e’ to bring up the edges menu.

Select ‘Mark Seam’ – More on Seams here. TLDR; basically seams are like folds in your texture, will make more sense later.

Split the screen by selecting the lower left 3 stripes things at the very edge of the corner, click and drag out to create 2 windows.

Back on the object screen, make sure your object is highlighted, then press ‘u’ for UV mapping menu, then select ‘Unwrap’.

Download this image

On the other texture mapping screen, select the ‘Image’ menu, then ‘open image’, navigate to this image.

On the texture mapping screen, type ‘a’ to select all and ‘r’ to rotate. Eventually you want to manipulate the texture to look something like this (Look doesn’t really matter here, just the basics)

Perfect symmetry doesn’t matter here, just get a decent map.

Now go over to your object screen and click where the ‘Viewport shading’ where you selected to make a wireframe, and select ‘Textured’. You should now see your texture!! I don’t care who you are, stand up make two fists and THRUST them into the air. Like a boss. Multiple times if needed.

In the top left, you will see a menu of items, select the ‘Materials’ page, (check out the screenshot below for reference)

Click on ‘New’

Now click the next icon in the menu up top, the texture menu.

Click on ‘New’

Click on open, navigate to where you saved the image above.

Click on the ‘Mapping’ tab down below

For ‘Coordinates’ select UV.

Now you should be able to export to .obj file and load with your favorite framework .obj loader method. Libgdx makes this as easy as can be. NOTE: Make sure your texture you use is in your ‘data’ directory like other libgdx image assets!(source:nfshost


上一篇:

下一篇: