If anyone has ever been working with OpenGL for 3D stuff probably in C or C++, well, WebGL is quite arcane, too, but in JavaScript ^^
Nevertheless, X3D for the rescue. X3D is a) an ISO standard (ISO/IEC 19775-1.2:2008 ), b) the successor of the working, but not really successful VRML97 (ISO/IEC 14772-1.2:1997) and c) a fully XML-based scenegraph declarative language. And the final ingredient is the Fraunhofer IGD experimental open source framework x3dom that thrives to integrate X3D content into HTML5.
Well, to the actual task. I am supposed to visualise a 3D geological model that originally has been designed with EarthVision(c). EarthVision(c) has its own binary format to store the 3D models, but they van be exported to a simpe XYZ-ASCII file:
2696105 6047205 150 20 11
2696605 6047205 150 21 11
2697105 6047205 150 22 11
2697605 6047205 150 23 11
2701105 6047205 150 30 11
...
The first two columns are Easting and Northing - implicitly known that the spatial reference system is New Zealand Map Grid. Third column is the height value and the further columns represent some additional attribute data. Based on the resolution, the surfaces from the roundabout 20 km by 30 km range from 50KB (500m), 1MB (100m) to 20MB (20m) per layer (5 layers altogether).
X3D provides two easy (point set based) possibilities to show surfaces (right now the geological layers are represented as surfaces, they are not described as full bodies).
- ElevationGrid
- IndexedFaceSet
I decided for the ElevationGrid. X3D has a geospatial extension (X3D Earth), which can geographically reference and place 3D objects in a defined spatial reference system. I didn't try this feature yet. And apparently it does not make sense to load 100MB for a 3D model into the browser. Therefore the 500m grid has been used here. The following example outlines a rather simple definition of such an elevation grid in X3D:
<shape>
<elevationgrid colorpervertex="false" creaseangle="3.14" def="Greywacke_top_500"
normalPerVertx="true" colorPerVertex='false' xDimension='37'
zDimension='44' xSpacing='500' zSpacing='500' creaseAngle='3.14' solid='false'
height='
150 150 150 ...
'>
</elevationgrid>
<appearance>
<material ambientintensity="0.1" diffusecolor="red" id="Greywacke"
shininess="0.2" specularcolor="lightred" transparency="0.0">
</material>
</appearance>
<shape>
To prepare that grid, you need to take care of some things:
- you need to know the extent and resolution of the dataset, from that you calculate and define the x- and zSpacing (how many values will be filled, because you only need the height values)
- the coordinate system orientation of the X3D 3-dimensional space is probably from the 2/2,5 coordinate system from the source dataset
- the source datasets only contained points with actual values, to fill the ElevationGrid properly, NODATA values need to added
Fig. 1: Preliminary (X)3D model with five layers and a (not aligned) image as an underlayer |
Hybsch bunt... gibt's das auch zum selberklicken?
ReplyDeleteIst noch unter Verschluss, pre-alpha sozusagen :-)
DeletePretty cool work!
ReplyDeleteI have been working on making some synthetic models for geology (mainly for education purposes):
http://app.visiblegeology.com
Hi Rowan,
Deletethanks very much :-) I actually have seen and played with your Visible Geology stuff several times already before when looking for "real" 3D geology stuff in the web :-)
I hope that I can develop the X3D / x3dom stuff a bit more in the next 2-3 years and actually blend in some other geospatial or spatio-temportal (eg hydrological) data, like wells and water levels.