diff options
Diffstat (limited to 'src/cube.c')
| -rw-r--r-- | src/cube.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/cube.c b/src/cube.c new file mode 100644 index 0000000..66723ac --- /dev/null +++ b/src/cube.c @@ -0,0 +1,39 @@ +#include "cube.h" + +ViewModel createCube() +{ + float vertices[] = { + 1.0f, 1.0f, -1.0f, + 1.0f, -1.0f, -1.0f, + -1.0f, -1.0f, -1.0f, + -1.0f, 1.0f, -1.0f, + + 1.0f, 1.0f, 1.0f, + 1.0f, -1.0f, 1.0f, + -1.0f, -1.0f, 1.0f, + -1.0f, 1.0f, 1.0f + }; + unsigned int indices[] = { + 0, 1, 2, + 0, 2, 3, + + 4, 5, 6, + 4, 6, 7, + + 0, 4, 5, + 2, 6, 3, + + 3, 7, 6, + 1, 5, 0, + + 3, 7, 0, + 0, 4, 7, + + 2, 6, 1, + 1, 5, 6 + }; + + ViewModel model; + createViewModel(&model, 8, vertices, 38, indices); + return model; +} |
