好吧,我为查看器使用了这段代码
//viewer.js
var MODEL_URLS = [
// "https://petrbroz.s3-us-west-1.amazonaws.com/svf-samples/sports-car/0.svf",
"https://bray-transformation-img.s3.ap-south-1.amazonaws.com/downloaded_svf/0.svf",
];
Autodesk.Viewing.Initializer({ env: "Local" }, async function () {
const viewer = new Autodesk.Viewing.GuiViewer3D(document.getElementById("preview"));
for (const url of MODEL_URLS) {
viewer.start(url);
}
});
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link
rel="stylesheet"
href="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/style.css"
type="text/css"
/>
<script
language="JavaScript"
src="https://developer.api.autodesk.com/modelderivative/v2/viewers/viewer3D.min.js?v=v7.*"
></script>
<style>
html,
body {
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
}
#preview {
height: 100%;
}
</style>
<title>Autodesk Forge: Local SVF</title>
</head>
<body>
<div id="preview"></div>
<script src="scripts/viewer.js"></script>
</body>
</html>
如果我使用此链接来访问 0.svf: https://petrbroz.s3-us-west-1.amazonaws.com/svf-samples/sports-car/0.svf 然后查看器就可以工作了。
但是当我使用我自己的来自 aws 的链接时: https://bray-transformation-img.s3.ap-south1.amazonaws.com/downloaded_svf/0.svf
那么是否有任何配置可以在 s3 中托管 svf 文件以便它可以工作?
*.svf 文件只是一个清单,通常使用相对文件路径引用其他文件(具有几何数据、纹理、相机信息、属性元数据等)。所有这些文件必须与 SVF 文件本身一起上传和提供。
在屏幕截图中,您可以看到查看器加载0.svf 文件后,它会寻找另一个名为 CameraDefinitions.bin 的文件,而该文件可能在您的 S3 存储桶中丢失。