Publishing 3D Documentation: X3D and X3DOM

0
704

To delve a little deeper into 3D model publishing strategies, I will focus this time on X3DOM technology, which, as its name suggests, is a 3D data exchange format oriented towards the web.

Currently, the trend of digitizing artifacts, works, or settings such as rock shelters or archaeological sites in 3D is spreading considerably as a practice, sometimes motivated by the desire for exhaustive documentation but often by mere technological showmanship, equipment promotions, or simple fashion. Often, the lack of clear objectives in 3D heritage documentation is compounded by the difficulty of making these 3D models public, so costly 3D modeling projects of sites or rock shelters frequently end up “falling on deaf ears” due to the challenges 3D faces for dissemination. At this point, X3DOM can offer us an interesting alternative to deliver our 3D projects to the public in a highly accessible way, without the need for plugins or proprietary viewers, albeit at the cost of sacrificing a significant degree of detail in our models to make our files as lightweight as possible.

X3DOM, although launched around 2010, can be considered an experimental project aimed at overcoming the difficulties of publishing 3D content on the web in an accessible manner, or in other words, without the need for additional plugins or viewers, since it is perfectly integrated with HTML5. This exchange standard is based on X3D, which in turn is based on XML, and although the conversion from X3D to X3DOM can be done manually, we can use tools like AOPT that accompany Instant Player to automate the process. On MacOsX, this tool is located at:

Player.app/Contents/MacOS/

To perform the conversion, we can use the following command line

./aopt  -i diosa.x3d -N diosa.html

The structures of X3D and X3DOM are quite simple; for example, for the latter, we can have a structure very similar to this:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv='X-UA-Compatible' content='chrome=1'></meta>
<meta http-equiv='Content-Type' content='text/html;charset=utf-8'></meta>
<link rel='stylesheet' type='text/css' href='http://www.x3dom.org/x3dom/release/x3dom.css'></link>
<script type='text/javascript' src='https://www.x3dom.org/x3dom/release/x3dom.js'></script>
</head>
<body>
<x3d id='x3dElement' showStat='false' showLog='false' width="400px" height="400px">
<scene>
<viewpoint centerOfRotation="0 0 -2" position='0.5 -0.8 0' fieldOfView='0.950022'></viewpoint>
<background skyColor='0 0 0'></background>
<shape>
<appearance>
<imageTexture url='"diosaTextura6.jpg"'></imageTexture>
</appearance>
<indexedFaceSet normalPerVertex='false' solid='false' texCoordIndex='...'></coordinate>
<normal vector='...'></normal>
<textureCoordinate point='...'></textureCoordinate>
</indexedFaceSet>
</shape>
</scene>
</x3d>
</body>
</html>

And X3D would have the following format:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.1//EN" "http://www.web3d.org/specifications/x3d-3.1.dtd">
<X3D profile="Immersive" version="3.1" xsd:noNamespaceSchemaLocation="http://www.web3d.org/specifications/x3d-3.1.xsd" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance">
<head>
<meta content="diosa.0.mesh_low_6.6_textura.x3d" name="title"/>
<meta content="Generated from Meshlab X3D Exported" name="description"/>
<meta content="16 febrero 2013" name="created"/>
</head>
<Scene>
<Shape>
<Appearance>
<ImageTexture url="diosaTextura6.png"/>
</Appearance>
<IndexedFaceSet coordIndex=”..."/>
<Normal vector="...."/>
<TextureCoordinate point="..."/>
</IndexedFaceSet>
</Shape>
</Scene>
</X3D>

Where the “…” replace the long strings of numbers that describe the geometry and texture of our models.

As we can see, both structures are quite similar except that X3DOM incorporates the classic HTML tags in addition to information related to the viewing conditions of our model, from the characteristics of our Background to the viewpoint of the observer or viewpoint through which we can customize the initial viewpoint we want to offer of our model. Additionally, in X3DOM we must include the library that allows the interpretation of X3D data called x3dom.js developed by the Fraunhofer company, which is currently essential for proper functioning.

X3D documents can be easily generated from MeshLab and support both textures projected on the mesh and UV textures separated in jpeg or png files.

Unfortunately, the size of these files is an important constraint when distributing these models over the Internet, so although with X3DOM we can work with highly complex or precise models, the final size these data can reach somewhat prevents web publication, so this technique can be useful for publishing small objects or models, as the Europeana project does through its 3D section where numerous objects from the Victoria & Albert Museum can be accessed, showcasing the possibilities of this technique. Similarly, through the X3DOM website itself, a small showcase of websites integrating this technology can be accessed. Designing meshes with the minimum number of polygons is essential to achieve the lightest possible documents; obviously, the sacrifice of textures and reliefs is severe, but the accessibility of this technology and the possibility of using photorealistic quality UV textures make X3DOM an option to consider in virtualization or heritage dissemination projects.

Documentacion 3D PatrimonioBeing a strategy perfectly integrated into the DOM (Document Object Model), it is possible to interact with our models through the usual web design techniques, such as javascript, CSS, etc.

To see an example of how this tool works, access this link: The Queen of Night

This technology is only supported by browsers that have WEBGL; this feature is supported by Firefox and Chrome, in Safari WEBGL support must be explicitly enabled, but in Internet Explorer things, as always, get complicated, since it is initially unclear whether IE will support WEBGL. On the X3DOM website you can read more about browser support.