aframe没有看到嵌入.gltf场景中的‘a-gltf-模型’- 404没有找到。(通过node.js)。但是如果我把src放到“a-emity”中--场景就在彩虹上的某个地方,宽度/高度为0/0。位置没什么用。起始场景(内联)很好。
所以,根目录中有两个文件,第一个是'index.js':
var express = require('express');
var app = express();
var path = require("path");
app.get('/', function (req, res) {
res.sendFile(path.join('C:/web/index.html'));
});
app.listen(3000, function () {
console.log('Example app listening on port 3000!');
});这里是“index.html”的内容:
<!DOCTYPE html>
<html>
<head>
<title>test aframe scene</title>
<script src="https://aframe.io/releases/0.8.0/aframe.min.js"></script>
</head>
<body>
<a-scene>
<a-gltf-model src="scene/archilogic/export.gltf"></a-gltf-model>
</a-scene>
</body>
</html>p.s. sry,我刚开始,这是测试任务,我以前和Blender一起工作过。原始场景这里
发布于 2018-05-31 06:05:12
此错误意味着您的模型(或它的某些部分)不是您的代码所声明的位置;如果没有完整的代码,我们几乎无法提供帮助。您还可以查看三维模型和托管上的A帧文档。
编辑:--既然您已经发布了一些代码,请注意,您的/服务器只接受/ URL上的请求。如果您想要通过它加载图像和模型,则需要设置它以提供额外的文件。来自在Express中服务静态文件
app.use(express.static('C:/web'))然后,您的所有文件都应该放在该文件夹中。
还请注意,Archilogic (此glTF文件的来源)使用了与最近的A帧版本不兼容的旧版本的glTF。如果你看不到模型这里,它就不会出现在A帧中.您需要glTF 2.0。
https://stackoverflow.com/questions/50615875
复制相似问题