Go to file
Tyler Hallada e0fc3c1917 Finally generating correct normals
Have to detect and correct inverted normals during calculation since the winding
order of the generated truncated icosahedrons is inconsistent.
2019-06-19 00:07:53 -04:00
output Finally generating correct normals 2019-06-19 00:07:53 -04:00
src Finally generating correct normals 2019-06-19 00:07:53 -04:00
.gitignore Initial commit: code and output 2019-02-18 00:25:30 -05:00
Cargo.lock Initial commit: code and output 2019-02-18 00:25:30 -05:00
Cargo.toml Initial commit: code and output 2019-02-18 00:25:30 -05:00
README.md Update README 2019-04-07 02:24:59 -04:00

Generates the shapes and then serializes them to a JSON file with a list of vertices (positions) and a list of triangle faces (cells) that index into the list of vertices. Suitable for input into Three.js's BufferGeometry or regl.

Icosahedrons can be generated significantly faster than Three.js's version in JavaScript (which I pretty much copied into Rust).

Trunacated icosahedrons (I call them hexspheres) are a bit slower to generate since they are made by generating a icosahedron and then subdividing it into hexagon and pentagon faces.

When rendering hexspheres of detail level 5 and higher and icosahedrons of detail level of 7 and higher in WebGL, make sure to enable the OES_element_index_uint extension since the number of vertices might overflow the normal int index.