When I use <Rectangle2D />
node, the rectangle did not display on canvas, and the debug console print a warning WARNING: Unrecognised X3D element <rectangle2d>.
. I try it with Chrome 67 and Firefox 61, and my code is as follow:
<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>
I found the problem, use x3dom-full.js
instead of x3dom.js
for the 2d geometries.