![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Example of using "Canvas" form "Graphics" library to display 3D graphics.
Dependencies: BSP_DISCO_F746NG Graphics mbed
Models/Cube.h@3:aca7fe2d44b3, 2016-11-11 (annotated)
- Committer:
- karpent
- Date:
- Fri Nov 11 17:06:53 2016 +0000
- Revision:
- 3:aca7fe2d44b3
- Parent:
- 1:4a5e329e617b
New 3d models added
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
karpent | 1:4a5e329e617b | 1 | // |
karpent | 1:4a5e329e617b | 2 | // Cube.h - example of usage graphics commands to create 3D graphics. |
karpent | 1:4a5e329e617b | 3 | // |
karpent | 1:4a5e329e617b | 4 | // This example is based on code written by |
karpent | 1:4a5e329e617b | 5 | // Fabio de Albuquerque Dela Antonio (fabio914 at gmail.com) |
karpent | 1:4a5e329e617b | 6 | // See : https://github.com/fabio914/arduinogl/blob/master/examples |
karpent | 1:4a5e329e617b | 7 | // |
karpent | 1:4a5e329e617b | 8 | |
karpent | 1:4a5e329e617b | 9 | #pragma once |
karpent | 1:4a5e329e617b | 10 | |
karpent | 1:4a5e329e617b | 11 | #include <ArduinoGL.h> |
karpent | 3:aca7fe2d44b3 | 12 | #include "Model.h" |
karpent | 1:4a5e329e617b | 13 | |
karpent | 1:4a5e329e617b | 14 | /** |
karpent | 1:4a5e329e617b | 15 | * @brief 3D model of the cube |
karpent | 1:4a5e329e617b | 16 | */ |
karpent | 3:aca7fe2d44b3 | 17 | class Cube : public Model |
karpent | 1:4a5e329e617b | 18 | { |
karpent | 1:4a5e329e617b | 19 | public: |
karpent | 1:4a5e329e617b | 20 | |
karpent | 1:4a5e329e617b | 21 | Cube(Display* display); |
karpent | 1:4a5e329e617b | 22 | |
karpent | 1:4a5e329e617b | 23 | /** |
karpent | 1:4a5e329e617b | 24 | * @brief Model setup. |
karpent | 1:4a5e329e617b | 25 | * @retval None |
karpent | 1:4a5e329e617b | 26 | */ |
karpent | 3:aca7fe2d44b3 | 27 | void virtual Setup(); |
karpent | 1:4a5e329e617b | 28 | |
karpent | 1:4a5e329e617b | 29 | /** |
karpent | 1:4a5e329e617b | 30 | * @brief Render single frame on the display. |
karpent | 1:4a5e329e617b | 31 | * @retval None |
karpent | 1:4a5e329e617b | 32 | */ |
karpent | 3:aca7fe2d44b3 | 33 | void virtual Render(); |
karpent | 1:4a5e329e617b | 34 | |
karpent | 1:4a5e329e617b | 35 | private: |
karpent | 1:4a5e329e617b | 36 | |
karpent | 1:4a5e329e617b | 37 | void DrawCube(); |
karpent | 1:4a5e329e617b | 38 | |
karpent | 1:4a5e329e617b | 39 | float _perspectiveAspect; |
karpent | 1:4a5e329e617b | 40 | }; |