![](/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/Sphere.h@2:ef3093a7a43e, 2016-11-11 (annotated)
- Committer:
- karpent
- Date:
- Fri Nov 11 15:30:07 2016 +0000
- Revision:
- 2:ef3093a7a43e
- Parent:
- 1:4a5e329e617b
- Child:
- 3:aca7fe2d44b3
Base Model class improved
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
karpent | 1:4a5e329e617b | 1 | // |
karpent | 1:4a5e329e617b | 2 | // Sphere.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 | #ifndef _SPHERE_H |
karpent | 1:4a5e329e617b | 10 | #define _SPHERE_H |
karpent | 1:4a5e329e617b | 11 | |
karpent | 1:4a5e329e617b | 12 | #include <ArduinoGL.h> |
karpent | 2:ef3093a7a43e | 13 | #include "Model.h" |
karpent | 1:4a5e329e617b | 14 | |
karpent | 1:4a5e329e617b | 15 | /** |
karpent | 1:4a5e329e617b | 16 | * @brief 3D model of the sphere |
karpent | 1:4a5e329e617b | 17 | */ |
karpent | 2:ef3093a7a43e | 18 | class Sphere : public Model |
karpent | 1:4a5e329e617b | 19 | { |
karpent | 1:4a5e329e617b | 20 | public: |
karpent | 1:4a5e329e617b | 21 | Sphere(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 | 2:ef3093a7a43e | 27 | void virtual Setup(); |
karpent | 1:4a5e329e617b | 28 | |
karpent | 1:4a5e329e617b | 29 | /** |
karpent | 1:4a5e329e617b | 30 | * @brief Renders model for given view angle. |
karpent | 1:4a5e329e617b | 31 | * @param None |
karpent | 1:4a5e329e617b | 32 | * @retval None |
karpent | 1:4a5e329e617b | 33 | */ |
karpent | 2:ef3093a7a43e | 34 | void virtual Render(); |
karpent | 1:4a5e329e617b | 35 | |
karpent | 1:4a5e329e617b | 36 | private: |
karpent | 1:4a5e329e617b | 37 | |
karpent | 1:4a5e329e617b | 38 | void DrawModel(float radius, float p); |
karpent | 1:4a5e329e617b | 39 | |
karpent | 1:4a5e329e617b | 40 | float _perspectiveAspect; |
karpent | 1:4a5e329e617b | 41 | }; |
karpent | 1:4a5e329e617b | 42 | |
karpent | 1:4a5e329e617b | 43 | #endif |