diff options
author | Tyler Murphy <tylermurphy534@gmail.com> | 2023-01-19 21:21:17 -0500 |
---|---|---|
committer | Tyler Murphy <tylermurphy534@gmail.com> | 2023-01-19 21:21:17 -0500 |
commit | a58decb97126c6fdcd2b5895cd29f143e8b9381f (patch) | |
tree | 063d4a7225d4e7a99577a8df5f1720d123c57142 /public/gl/model | |
parent | fix projection (diff) | |
download | webgl-a58decb97126c6fdcd2b5895cd29f143e8b9381f.tar.gz webgl-a58decb97126c6fdcd2b5895cd29f143e8b9381f.tar.bz2 webgl-a58decb97126c6fdcd2b5895cd29f143e8b9381f.zip |
Diffstat (limited to 'public/gl/model')
-rw-r--r-- | public/gl/model/Cube.js | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/public/gl/model/Cube.js b/public/gl/model/Cube.js deleted file mode 100644 index 8583afb..0000000 --- a/public/gl/model/Cube.js +++ /dev/null @@ -1,65 +0,0 @@ -import { Mesh } from '../core/Mesh.js' - -export const Cube = () => { - - const data = [ - -1.0, 1.0, -1.0, 0.5, 0.5, 0.5, - -1.0, 1.0, 1.0, 0.5, 0.5, 0.5, - 1.0, 1.0, 1.0, 0.5, 0.5, 0.5, - 1.0, 1.0, -1.0, 0.5, 0.5, 0.5, - -1.0, 1.0, 1.0, 0.75, 0.25, 0.5, - -1.0, -1.0, 1.0, 0.75, 0.25, 0.5, - -1.0, -1.0, -1.0, 0.75, 0.25, 0.5, - -1.0, 1.0, -1.0, 0.75, 0.25, 0.5, - 1.0, 1.0, 1.0, 0.25, 0.25, 0.75, - 1.0, -1.0, 1.0, 0.25, 0.25, 0.75, - 1.0, -1.0, -1.0, 0.25, 0.25, 0.75, - 1.0, 1.0, -1.0, 0.25, 0.25, 0.75, - 1.0, 1.0, 1.0, 1.0, 0.0, 0.15, - 1.0, -1.0, 1.0, 1.0, 0.0, 0.15, - -1.0, -1.0, 1.0, 1.0, 0.0, 0.15, - -1.0, 1.0, 1.0, 1.0, 0.0, 0.15, - 1.0, 1.0, -1.0, 0.0, 1.0, 0.15, - 1.0, -1.0, -1.0, 0.0, 1.0, 0.15, - -1.0, -1.0, -1.0, 0.0, 1.0, 0.15, - -1.0, 1.0, -1.0, 0.0, 1.0, 0.15, - -1.0, -1.0, -1.0, 0.5, 0.5, 1.0, - -1.0, -1.0, 1.0, 0.5, 0.5, 1.0, - 1.0, -1.0, 1.0, 0.5, 0.5, 1.0, - 1.0, -1.0, -1.0, 0.5, 0.5, 1.0, - ]; - - const indicies = [ - 0, 1, 2, - 0, 2, 3, - 5, 4, 6, - 6, 4, 7, - 8, 9, 10, - 8, 10, 11, - 13, 12, 14, - 15, 14, 12, - 16, 17, 18, - 16, 18, 19, - 21, 20, 22, - 22, 20, 23 - ]; - - const verticies = [] - const colors = [] - - for (let x = 0; x < indicies.length; x++) { - var i = indicies[x] - verticies.push(data[i * 6 + 2]) - verticies.push(data[i * 6 + 1]) - verticies.push(data[i * 6 + 0]) - colors.push(data[i * 6 + 3]) - colors.push(data[i * 6 + 4]) - colors.push(data[i * 6 + 5]) - } - - return new Mesh(indicies.length) - .store(verticies, 3) - .store(colors, 3) - .finish() - -}
\ No newline at end of file |