当我使用<Rectangle2D />
节点时,该矩形未显示在画布上,并且调试控制台将打印警告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>
答案 0 :(得分:0)
我发现了问题,对于二维几何图形,使用x3dom-full.js
代替x3dom.js
。