I am looking for a way to display some meshes with color mapping in Chrome browser, so I have tried x3dom
and indexedFaceSet
. I assume there is a way to assign colors to vertices so that the color of the face is interpolated or at least I should be able to assign different constant color to each face. It seems that no matter what I try, I can only display lines of the faces and defined colors have no effect.
Currently, I have this html code:
<html>
<head>
<script type='text/javascript' src='http://www.x3dom.org/download/x3dom.js'> </script>
<link rel='stylesheet' type='text/css' href='http://www.x3dom.org/download/x3dom.css'></link>
</head>
<body>
<X3D width='600px' height='400px' showLog='true'>
<Scene>
<Shape>
<IndexedFaceSet coordIndex='0 1 2 -1, 1 2 3 -1' colorPerVertex='true' solid='false'>
<Coordinate point='0 0 0, 1 0 0, 0 1 0, 1 1 0'/>
<Color color='0 1 0, 1 0 0, 0 0 1, 0 1 0'/>
</IndexedFaceSet>
</Shape>
</Scene>
</X3D>
</body>
</html>
I suppose, I am either missing something very simple or x3dom does not work properly on my machine.