- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
美好的一天,
我正在尝试将在 Blender 中制作的模型导出为 JSON 格式,以便我可以在我的 THREE.js Web 应用程序中使用它。除了似乎无法正确导出 Material 之外,一切工作正常。在 Blender 中,我的模型是彩色的,但是当使用 THREE.js 在 Web 浏览器中查看时,模型是灰色的。
以下是两个输出的样子: /image/4zIMG.png
这是将 JSON 文件加载到程序中的代码:
var loader = new THREE.JSONLoader();
loader.load("../tankSingleObject2.json", addModel );
function addModel(geometry, materials) {
var mesh = new THREE.Mesh (geometry, materials);
scene.add(mesh);
mesh.position.z = -2;
}
JSON 文件如下所示:
{
"vertices":[0.202124,0.554841,0.275849,0.402124,0.554841,0.275849,0.202124,0.554841,0.0758486,0.402124,0.554841,0.0758486,-0.404745,0.554792,0.279759,-0.204745,0.554792,0.279759,-0.404745,0.554792,0.0797591,-0.204745,0.554792,0.0797591,-0.61,0.0287037,0.321036,-0.61,0.528704,0.321036,-0.61,0.0287037,0.0030361,-0.61,0.528704,0.00303607,0.61,0.0287037,0.321036,0.61,0.528704,0.321036,0.61,0.0287037,0.0030361,0.61,0.528704,0.00303607,-0.594359,0.529223,0.305839,-0.594359,0.529223,0.0182327,0.594359,0.529223,0.0182327,0.594359,0.529223,0.305839,-0.594359,0.0387877,0.30584,-0.594359,0.0387877,0.0182327,0.594359,0.0387877,0.0182327,0.594359,0.0387877,0.30584,0,0.118215,0.0370853,0,0.318215,0.137085,0.019509,0.118215,0.0390067,0.0382684,0.118215,0.0446973,0.055557,0.118215,0.0539383,0.0707107,0.118215,0.0663746,0.083147,0.118215,0.0815282,0.0923879,0.118215,0.0988169,0.0980785,0.118215,0.117576,0.1,0.118215,0.137085,0.0980785,0.118215,0.156594,0.092388,0.118215,0.175354,0.083147,0.118215,0.192642,0.0707107,0.118215,0.207796,0.055557,0.118215,0.220232,0.0382683,0.118215,0.229473,0.019509,0.118215,0.235164,-2.98023e-08,0.118215,0.237085,-0.0195091,0.118215,0.235164,-0.0382684,0.118215,0.229473,-0.0555571,0.118215,0.220232,-0.0707107,0.118215,0.207796,-0.083147,0.118215,0.192642,-0.092388,0.118215,0.175354,-0.0980785,0.118215,0.156594,-0.1,0.118215,0.137085,-0.0980785,0.118215,0.117576,-0.0923879,0.118215,0.0988168,-0.0831469,0.118215,0.0815281,-0.0707106,0.118215,0.0663745,-0.0555569,0.118215,0.0539382,-0.0382682,0.118215,0.0446972,-0.0195089,0.118215,0.0390067,0.612,0.5154,-8.9407e-08,-0.612,0.5154,2.98023e-08,0.612,0.5514,-8.9407e-08,-0.612,0.5514,2.98023e-08,0.612,0.515076,0.327056,-0.612,0.515076,0.327056,0.612,0.551076,0.327056,-0.612,0.551076,0.327056,0.612,0,-5.96046e-08,-0.612,0,5.96046e-08,0.612,0.036,-5.96046e-08,-0.612,0.036,5.96046e-08,0.612,-0.000323951,0.327056,-0.612,-0.000323951,0.327056,0.612,0.035676,0.327056,-0.612,0.035676,0.327056],
"faces":[3,0,1,3,2,0,3,4,5,7,6,0,3,8,9,11,10,1,3,10,11,15,14,1,3,14,15,13,12,1,3,12,13,9,8,1,3,10,14,12,8,1,3,13,15,18,19,1,3,19,18,22,23,1,3,11,9,16,17,1,3,9,13,19,16,1,3,15,11,17,18,1,3,22,21,20,23,1,3,17,16,20,21,1,3,16,19,23,20,1,3,18,17,21,22,1,2,24,25,26,2,2,26,25,27,2,2,27,25,28,2,2,28,25,29,2,2,29,25,30,2,2,30,25,31,2,2,31,25,32,2,2,32,25,33,2,2,33,25,34,2,2,34,25,35,2,2,35,25,36,2,2,36,25,37,2,2,37,25,38,2,2,38,25,39,2,2,39,25,40,2,2,40,25,41,2,2,41,25,42,2,2,42,25,43,2,2,43,25,44,2,2,44,25,45,2,2,45,25,46,2,2,46,25,47,2,2,47,25,48,2,2,48,25,49,2,2,49,25,50,2,2,50,25,51,2,2,51,25,52,2,2,52,25,53,2,2,53,25,54,2,2,54,25,55,2,2,55,25,56,2,2,56,25,24,2,2,56,24,26,2,2,26,27,28,2,2,28,29,30,2,2,30,31,32,2,2,32,33,34,2,2,34,35,36,2,2,36,37,38,2,2,38,39,40,2,2,40,41,42,2,2,42,43,44,2,2,44,45,46,2,2,46,47,48,2,2,48,49,50,2,2,50,51,52,2,2,52,53,54,2,2,54,55,56,2,2,56,26,28,2,2,28,30,32,2,2,32,34,36,2,2,36,38,40,2,2,40,42,44,2,2,44,46,48,2,2,48,50,52,2,2,52,54,56,2,2,56,28,32,2,2,32,36,40,2,2,40,44,48,2,2,48,52,56,2,2,56,32,40,2,2,40,48,56,2,3,57,58,60,59,3,3,61,62,64,63,3,3,57,59,63,61,3,3,60,58,62,64,3,3,65,66,68,67,3,3,69,70,72,71,3,3,65,67,71,69,3,3,68,66,70,72,3],
"metadata":{
"generator":"io_three",
"version":3,
"type":"Geometry",
"materials":4,
"faces":86,
"vertices":73
},
"materials":[{
"depthTest":true,
"DbgIndex":0,
"wireframe":false,
"opacity":1,
"blending":1,
"shading":"phong",
"doubleSided":false,
"DbgName":"Material.007",
"specularCoef":50,
"colorEmissive":[0,0,0],
"depthWrite":true,
"transparent":false,
"colorSpecular":[0.5,0.5,0.5],
"DbgColor":15658734,
"colorDiffuse":[0.64,0.64,0.64],
"visible":true
},{
"depthTest":true,
"DbgIndex":1,
"wireframe":false,
"opacity":1,
"blending":1,
"shading":"phong",
"doubleSided":false,
"DbgName":"Material.006",
"specularCoef":50,
"colorEmissive":[0,0,0],
"depthWrite":true,
"transparent":false,
"colorSpecular":[0.5,0.5,0.5],
"DbgColor":15597568,
"colorDiffuse":[0.64,0.64,0.64],
"visible":true
},{
"depthTest":true,
"DbgIndex":2,
"wireframe":false,
"opacity":1,
"blending":1,
"shading":"phong",
"doubleSided":false,
"DbgName":"Material.005",
"specularCoef":50,
"colorEmissive":[0,0,0],
"depthWrite":true,
"transparent":false,
"colorSpecular":[0.5,0.5,0.5],
"DbgColor":60928,
"colorDiffuse":[0.64,0.64,0.64],
"visible":true
},{
"depthTest":true,
"DbgIndex":3,
"wireframe":false,
"opacity":1,
"blending":1,
"shading":"phong",
"doubleSided":false,
"DbgName":"Material",
"specularCoef":50,
"colorEmissive":[0,0,0],
"depthWrite":true,
"transparent":false,
"colorSpecular":[0.5,0.5,0.5],
"DbgColor":238,
"colorDiffuse":[0.64,0.64,0.64],
"visible":true
}]}
可以在此处查看 Blender 文件:https://www.dropbox.com/s/q9u7kr6rqqciknh/tankSingleObject1.blend?dl=0
预先感谢您的帮助!
最佳答案
幸运的是,经过一番折腾,我找到了解决方案。对于同样情况的其他人,请从 Cycles 切换到 Blender Renderer。
关于javascript - Blender 导出到 JSON 以查找缺少 Material 的 THREE.js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47667153/
我正在尝试在 map 上绘制一些疾病事件数据的位置。 我用它来导入数据: ByTown% addProviderTiles("CartoDB.Positron")%>% addPolygons
我有一个文件调用 find.js,我使用 node find.js 运行,我的节点是版本 10 我不知道为什么我无法使用 async await。 const axios = require("axi
我有一个项目作为引用添加到 System.Web。 但是,它似乎无法获取 HttpContext。这样做: Imports System.Web _ApplicationBase = HttpCont
在互联网上找到这段代码,出于某种原因它缺少 while 循环逻辑“while(i....)”,虽然我找到了 PigLatin* 问题的其他可行解决方案,但我真的很想了解这个正在工作。 *PigLati
我工作了一整天来运行 Xampp 并在其上安装 TYPO3。现在我登录到后端,但没有显示许多管理模块,例如模板、访问等。 - 一定是我做错了什么,但我不知道。 these are the module
你好 我有编译这个问题 \begin{equation} J = \sum_{j=1}^{C} \end{equation} 我不断收到错误 missing $ inserted 这很奇怪,因
我正在尝试使用 SQLite CLI,但无法获得 generate_series功能来工作。我可以按照文档中的建议使用递归 CTE 对其进行模拟,但我似乎无法获得该链接中的任何示例。这是我的 sess
我目前正在开发我想要的软件,而软件正在安装,它可以在后台为软件创建 native 图像。 我正在考虑使用 NGEN 并将进程优先级设置为低,因为我不希望它消耗 100% CPU。但是我发现我的计算机上
我想使用 Xcodes Instruments 进行 UI 自动化测试。但似乎缺少“自动化”。我怎样才能添加这个? 最佳答案 如果您想使用自动化仪器,请使用 Xcode 7.3。 Apple 在 Xc
我目前在 JS 开发中迈出了一小步,并编写了以下链接添加器: const button = document.getElementById('button') const listdiv = docu
此代码有什么问题: NSError *error = nil; [SFHFKeychainUtils deleteItemForUsername:@"IAPNoob01" andServiceName
出于某种原因,在安装和配置(我认为)一切之后,com.adobe.utils.AGALMiniAssembler 不见了,其他一切正常。 我认为我已尽一切努力让孵化器正常工作,但显然我错过了一步。 如
我有一个名为 new 的方法。调用 new 时,我传递了一个参数,但是当我运行应用程序时,出现没有参数或参数为空的错误。 StepReader.pm package StepReader; use s
安装 gtk 1.2(包名 gtk1)和 macports chokes 在最终的 make 中,在 libintl.h 的第 440 行。 extern locale_t libintl_newlo
我用按钮创建表格。 这是javascript代码: function layersListTable(layers) { var content =''; $.each($(layer
我在使用此 javascript 时遇到此错误,任何人都可以帮我弄清楚我做错了什么吗? $(this).prepend('Check availability »'); 它给我错误 mis
我有一个独立的工具链 NDK13b、api19、llvm 3.8 编译器、arm 32 位、带有 libcpp(llvm C++ 库) 我想避免依赖 libgcc,所以我构建了 compiler-rt
我按照一些教程使用 phonegap 的条形码扫描器插件。但是当我从现有源创建一个新的 android 项目来创建条码库时 (step 6 in this page)我收到错误:“AndroidMan
我现在尝试在 Eclipse 中打开我的布局 xml 文件。我只得到错误 No XML content. Please add a root view or layout to your docume
我的 android-sdk-windows\tools 目录中缺少层次结构查看器工具。 工具链接: http://developer.android.com/guide/developing/too
我是一名优秀的程序员,十分优秀!