Babylon.js-使用Blender创建的模型看起来是圆形的并且形状怪异 [英] Babylon.js - models created with Blender appear rounded and weirdly shaped

查看:586
本文介绍了Babylon.js-使用Blender创建的模型看起来是圆形的并且形状怪异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究Babylon.js项目.因此,我使用Blender创建了一个测试模型(.babylon)(导出工作正常,没有任何错误).

I am working on a Babylon.js project. Therefore I created a test model (.babylon) with Blender (the export worked perfectly without any errors).

我的问题是:浏览器中的模型 1 (Babylon.js)看上去与Blender中的模型有些不同 2 .

My Problem is: The model in my browser 1 (Babylon.js) looks somewhat different than the model in Blender 2.

巴比伦模型

搅拌机中的模型

要将网格导入到我的巴比伦场景中,我正在使用BABYLON.SceneLoader.ImportMesh.

To import the mesh to my Babylon scene, i am using BABYLON.SceneLoader.ImportMesh.

Babylon.js似乎有点难以理解,我真的不明白-有很多完美模型的例子!我知道我在做某事.完全错误,但我只是无法弄清楚它是什么...到目前为止,我尝试了一些操作,例如使用较旧的Blender版本,重新安装export-python-script并像疯子一样进行谷歌搜索.有人知道我在做什么错吗? (我没有在Blender中向网格添加任何修改器)

Babylon.js seems to somehow round the edged, which I really don't understand - there are plenty of examples of perfect models! I know I am doing sth. terribly wrong, but I just can't figure out what it is... So far I tried things like using older Blender Versions, reinstalling the export-python-script and googling like a lunatic. Does anyone have an idea what I'm doing wrong? (I did not add any modifiers to the mesh in Blender)

TL; DR :使用使用Blender创建的.babylon文件,Babylon.js中的模型看起来很奇怪(锐利的边缘有些圆).

TL;DR: models in Babylon.js look weird (sharp edges are somehow round) - using .babylon file created with Blender.

推荐答案

看起来表面法线正在被平均,以便着色器对各个多边形进行插值,并使形状看起来更平滑.我不确定是由Blender导出还是由Babylonjs引起的.但是,如果比较轮廓,则实际几何形状是相同的.请记住,通常希望具有这种效果,尤其是对于有机模型. 如果您不熟悉法线,请查看

It looks like the surface normals are being averaged, so that the shader interpolates the individual polygons and makes the shape look smoother. I am not sure whether it is the Blender export or the Babylonjs material that's causing it. The actual geometry is the same though, if you compare the silhouettes. Keep in mind that it's often desirable to have this effect, especially for organic models. In case you are not familiar with normals, have a look at http://www.scratchapixel.com/lessons/3d-basic-rendering/introduction-to-shading/shading-normals which probably explains it better.

如果要保留搅拌器的平面阴影外观,请尝试执行以下操作: monkey_shape.convertToFlatShadedMesh()

If you want to retain flat shaded look from blender, try doing some like: monkey_shape.convertToFlatShadedMesh()

这篇关于Babylon.js-使用Blender创建的模型看起来是圆形的并且形状怪异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆