Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
main.cpp@4:759a5c34e239, 2019-02-22 (annotated)
- Committer:
- el17cd
- Date:
- Fri Feb 22 19:05:28 2019 +0000
- Revision:
- 4:759a5c34e239
- Parent:
- 3:2e31dfcb712a
- Child:
- 5:54d3b36fec2c
Cube Class implemented, when instantiated it created 12 vertices and 6 faces
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| el17cd | 0:efb5eec6b8ea | 1 | /* |
| el17cd | 0:efb5eec6b8ea | 2 | ELEC2645 Embedded Systems Project |
| el17cd | 0:efb5eec6b8ea | 3 | School of Electronic & Electrical Engineering |
| el17cd | 0:efb5eec6b8ea | 4 | University of Leeds |
| el17cd | 0:efb5eec6b8ea | 5 | Name: Christopher Doel |
| el17cd | 0:efb5eec6b8ea | 6 | Username: el17cd |
| el17cd | 0:efb5eec6b8ea | 7 | Student ID Number: 201146223 |
| el17cd | 0:efb5eec6b8ea | 8 | Date: 22/02/19 |
| el17cd | 0:efb5eec6b8ea | 9 | */ |
| el17cd | 0:efb5eec6b8ea | 10 | |
| el17cd | 0:efb5eec6b8ea | 11 | #include "mbed.h" |
| el17cd | 1:044238f7bdda | 12 | #include <vector> |
| el17cd | 4:759a5c34e239 | 13 | #ifndef FACE_H |
| el17cd | 4:759a5c34e239 | 14 | #define FACE_H |
| el17cd | 3:2e31dfcb712a | 15 | #include "Face.h" |
| el17cd | 4:759a5c34e239 | 16 | #endif |
| el17cd | 4:759a5c34e239 | 17 | #include "Rasturizer.h" |
| el17cd | 4:759a5c34e239 | 18 | #include "Cube.h" |
| el17cd | 3:2e31dfcb712a | 19 | |
| el17cd | 0:efb5eec6b8ea | 20 | |
| el17cd | 2:a5bc7b3779f7 | 21 | |
| el17cd | 0:efb5eec6b8ea | 22 | int main() |
| el17cd | 0:efb5eec6b8ea | 23 | { |
| el17cd | 4:759a5c34e239 | 24 | Rasturizer renderer; |
| el17cd | 4:759a5c34e239 | 25 | Cube cube(30,30, 1,10); |
| el17cd | 4:759a5c34e239 | 26 | int i = 0; |
| el17cd | 1:044238f7bdda | 27 | while(1) { |
| el17cd | 4:759a5c34e239 | 28 | renderer.clear(); |
| el17cd | 4:759a5c34e239 | 29 | if (i == 6) |
| el17cd | 4:759a5c34e239 | 30 | i = 0; |
| el17cd | 4:759a5c34e239 | 31 | renderer.drawFace(cube.getFace(i)); |
| el17cd | 4:759a5c34e239 | 32 | renderer.refresh(); // refresh the LCD so the pixels appear |
| el17cd | 1:044238f7bdda | 33 | wait_ms(1000/1); // this gives a refresh rate of 10 frames per second |
| el17cd | 4:759a5c34e239 | 34 | i++; |
| el17cd | 0:efb5eec6b8ea | 35 | } |
| el17cd | 0:efb5eec6b8ea | 36 | } |