How can I embed a 3D file into HTML for it's rendering on the web browser?
I want to do something like this
<!doctype html>
<html lang="en">
<head>
<!-- stuff -->
</head>
<body>
<!-- stuff -->
<canvas>
<X3D profile="Interchange" version="3.2"
xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance"
xsd:noNamespaceSchemaLocation="http://www.web3d.org/specifications/x3d-3.2.xsd">
<Scene>
<Shape>
<IndexedFaceSet coordIndex="0 1 2">
<Coordinate point="0 0 0 1 0 0 0.5 1 0"/>
</IndexedFaceSet>
</Shape>
</Scene>
</X3D>
</canvas>
<!-- stuff -->
<script src="js/scripts.js"></script>
</body>
</html>
I have a script that manipulates 3D models and then generates web reports. These reports are always seen offline.
I know there are javascript libraries that allow you to do this. The problem is that neither the reports nor the models are hosted in a web server and you can not have access to local-files from javascript (I'm not changing chrome's file access permissions ;) ).
I want to be able to distribute the html files for people to see them offline without having a web-server available. I can generate the 3D models in any format I want (X3D in the above example) as long as it gets rendered in the browser.
It would be preferred if the model was embedded in a declarative way using markup-only, but also javascript is acceptable.