使用blender做一个地球模型,贴上UV纹理,导出Obj格式
Table of Contents
1 blender 1.1 图文教程 1.2 export to objloader, coordinate rotate 1.3 UV image editor: add texture to surface1 blender
1.1 图文教程
我用的blender版本是2.63.0,各个版本之间应该是大同小异的
首先打开blender, 删除startup默认添加的cube(左键选中后,按一下del), 这样就是一个空白的world了。
从mech菜单中,选择添加一个UV sphere, 快捷键是 'shift+a':
球就出来了:
为了能够一遍编辑这个Sphere, 一边编辑UV映射, 我们拉开一个新的窗口。点击下图中的这个三角,往左拉动,就变成2个窗口了:
然后左边切换到 Edit-Mode(快捷键 Tab), 右边把Editor切换到 UV/Image Editor. 两个切换的地方不一样:
然后在右边的 UV/Image Editor中添加一个Material, 然后添加Texture, 选择子菜单中Type为Image, 然后子菜单中打开图片, 然后最下面的图片选项,选择我们刚才打开的图片:
结果就是这样:
然后左边切换到Editor-Mode以后,选择unwrap, 选择 sphere projection, 如下调整参数,这样右边就会出现UV网络,用translate, scale, rotate调整到你想要的地方就完了:
参数:
好了, 在选中左边的窗口, 按一下F12, 就能看到结果了:
最后是导出Obj格式, 需要注意Blender里面的坐标是右手坐标系,向后躺下来的. 所以, 这里要调整一下坐标系方向(Y forward), 同时做好用Triangle Face应为后面的Objloader没有那么高端:
这样,我们就得到了旋转地球的2个素材, obj和一张png, obj里面包含了模型点坐标,normal坐标,uv坐标,png则是我们准备贴上去的纹理资源.
下面两项是总结与其它链接
1.2 export to objloader, coordinate rotate
blender's coordinate is x-right, y-forward, z-up. But opengl isx-right, y-up, -z-forward. So when use blender export .obj file, thecoordinate system should changed
1.3 UV image editor: add texture to surface
inObject Mode, select which object you want to add texturepresstab, switch toEdit Mode.a, for select all vertex;seam, for let blender know where should start unwrap;or use smart unwrap/projection, or sphere projectinObject Mode, pressu, show the UV menu, select unwrap. Thiswill show theUV Image editor.InUV image editor, addMaterialto object, then addTexturetoMaterial. selectTexturetype to image, than pressalt+oor selectopen imageto open external resource. useg, s, r, addtionalx, y, zstrict into given coordinate, torerange the UVs to match pixels inTexturesave & exportread exampleoffical_manul
earth_example
http://digitized-life.blogspot.jp//07/blender-249-uv.html