我试图在我的网页上获得3d模型,并找到了这个非常漂亮的网站和教程,但是在我自己的网站中进行放大会引起一些问题。
教程:https://doc.x3dom.org/tutorials/models/inline/index.html
起初,将此示例代码复制到我自己的页面上时,我得到了404.3,因为IIS不支持.x3d文件。
<x3d width='500px' height='400px'>
<scene>
<inline nameSpaceName="Deer" mapDEFToID="true" onclick='redNose();' url="Deer.x3d" > </inline>
</scene>
</x3d>
由于.x3d文件基本上是XML。我在我的web.config中添加了以下几行
<staticContent>
<remove fileExtension=".x3d" />
<mimeMap fileExtension=".x3d" mimeType="text/xml" />
</staticContent>
通过这些行查找,该文件不再提供404,但是现在它提供了通用406.0,不被接受。此外,根据chrome开发工具上的“网络”标签,它说类型是xhr而不是xml。