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