X3D 无法识别 <rectangle2d>
X3D don't recognise <rectangle2d>
当我使用 <Rectangle2D />
节点时,矩形没有显示在 canvas 上,调试控制台打印警告 WARNING: Unrecognised X3D element <rectangle2d>.
。我用 Chrome 67 和 Firefox 61 试了一下,我的代码如下:
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>X3DOM page</title>
<script type='text/javascript' src='https://www.x3dom.org/download/x3dom.js'></script>
<link rel='stylesheet' type='text/css' href='https://www.x3dom.org/download/x3dom.css'></link>
</head>
<body>
<X3D width='500px' height='400px'>
<Scene>
<Shape>
<Appearance DEF='MagentaAppearance'>
<Material diffuseColor='0 1 0' />
</Appearance>
<Rectangle2D ccw='true' lit='true' size='7,7' solid='true'></Rectangle2D>
</Shape>
</Scene>
</X3D>
</body>
</html>
我发现了问题,对 2d 几何体使用 x3dom-full.js
而不是 x3dom.js
。
当我使用 <Rectangle2D />
节点时,矩形没有显示在 canvas 上,调试控制台打印警告 WARNING: Unrecognised X3D element <rectangle2d>.
。我用 Chrome 67 和 Firefox 61 试了一下,我的代码如下:
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>X3DOM page</title>
<script type='text/javascript' src='https://www.x3dom.org/download/x3dom.js'></script>
<link rel='stylesheet' type='text/css' href='https://www.x3dom.org/download/x3dom.css'></link>
</head>
<body>
<X3D width='500px' height='400px'>
<Scene>
<Shape>
<Appearance DEF='MagentaAppearance'>
<Material diffuseColor='0 1 0' />
</Appearance>
<Rectangle2D ccw='true' lit='true' size='7,7' solid='true'></Rectangle2D>
</Shape>
</Scene>
</X3D>
</body>
</html>
我发现了问题,对 2d 几何体使用 x3dom-full.js
而不是 x3dom.js
。