Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
priscavdsluis committed Apr 19, 2024
1 parent 66c8a83 commit a53428c
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
# Contents

- [Contents](#contents)
- [D-HYDRO netCDF output to glTF converter](#d-hydro-netcdf-output-to-gltf-converter)
- [Disclaimer](#disclaimer)
- [NetCDF output to glTF converter](#netcdf-output-to-gltf-converter)
- [Why use glTF](#why-use-gltf)
- [Supported models](#supported-models)
- [User guide](#user-guide)
- [Requirements](#requirements)
- [Installation](#installation)
Expand All @@ -19,9 +21,13 @@
- [Contributing](#contributing)
- [Acknowledgments](#acknowledgments)

# D-HYDRO netCDF output to glTF converter
# Disclaimer

This is a tool that converts D-HYDRO map output results that are stored in the netCDF file format to the glTF file format. The goal is to allow users who work with D-HYDRO results to view their data in 3D renderers using the glTF format.
This tool is a proof-of-concept, which means it has been tested in a limited scope and may not handle all real-world cases effectively. As many cases have not been validated, conversion may fail in certain scenarios.

# NetCDF output to glTF converter

This is a tool that converts hydrodynamical model output results that are stored in the netCDF file format to the glTF file format. The goal is to allow users to view their data in 3D renderers using the glTF format.

<p align="center">
<img src="docs/readme/img/example.gif" alt="animated" />
Expand All @@ -31,6 +37,13 @@ This is a tool that converts D-HYDRO map output results that are stored in the n
[glTF (GL Transmission Format)](https://www.khronos.org/gltf/) is an open-standard file format developed by [The Khronos Group](https://www.khronos.org/). The glTF file format is used for 3D scenes and models designed for efficient transmission and loading of 3D content on the web and other real-time applications. This file format can store geometry, materials, textures, animations, and other scene data.
glTF is used in a variety of industries and applications, including gaming, virtual and augmented reality, education, and more. It is particularly well-suited for web-based applications, as it allows 3D content to be easily and efficiently delivered over the internet, and can be rendered in real-time on a wide range of devices.

# Supported models

Currently, this tool supports the conversion of the following hydrodynamical models:

- D-HYDRO (map)
- XBEACH

# User guide
## Requirements
- Python >=3.9, <3.12
Expand Down Expand Up @@ -149,7 +162,7 @@ In the above example, we render two variables from a D-HYDRO output map netCDF f
For the `Mesh2d_waterdepth` variable, an additional threshold mesh is rendered at a height of 0.01. Each mesh is assigned its own color, specified by the normalized red, green, blue and alpha (RGBA) values.

## Logging
During conversion, a log file is written to the output folder (folder of the resulting glTF file) with the name: `gltf_converter_<date>_<time>.log`
During conversion, a log file is written to the output folder (folder of the resulting glTF file) with the name: `gltf_converter_<date>_<time>_<gltf-name>.log`

## View results
Several glTF viewers exist that can be used to view the produced glTF file. Simply drag and drop the file, and the glTF file will be rendered.
Expand All @@ -158,7 +171,7 @@ During conversion, a log file is written to the output folder (folder of the res

# Methodology
The converter operates through the following steps:
1. If specified in the configuration file, the x- and y-coordinates are shifted such that the smallest x and y become the origin (0,0).
1. If specified in the configuration file, the x- and y-coordinates and possibly z-coordinates (variable values) are shifted such that the dataset contains an origin point.
2. If specified in the configuration file, the geometry is scaled with the desired scaling factor.
3. The 2D grid from the netCDF file is triangulated, allowing it to be passed to glTF. In order to render a mesh, glTF requires a geometry definition that consists of triangles.
4. For each specified variable in the configuration file:
Expand Down Expand Up @@ -199,7 +212,7 @@ If you encounter any issues or have good ideas for this project please [create a
# Acknowledgments
[Connec2](https://connec2.nl/) is a company specialized in cross reality (XR) technology that guided us to setup this project.

This tool was developed as part of the [D-HYDRO GUI Visualisatie & Cloud project](https://tkideltatechnologie.invoermodule.nl/project/d-hydro-gui-visualisatie-cloud/), which was funded by the fifth Top consortium for Knowledge and Innovation (TKI) programme.
This tool was initially developed as part of the [D-HYDRO GUI Visualisatie & Cloud project](https://tkideltatechnologie.invoermodule.nl/project/d-hydro-gui-visualisatie-cloud/), which was funded by the fifth Top consortium for Knowledge and Innovation (TKI) programme.



Expand Down

0 comments on commit a53428c

Please sign in to comment.