Example of using "Canvas" form "Graphics" library to display 3D graphics.

Dependencies:   BSP_DISCO_F746NG Graphics mbed

Committer:
karpent
Date:
Fri Nov 11 17:06:53 2016 +0000
Revision:
3:aca7fe2d44b3
Parent:
2:ef3093a7a43e
New 3d models added

Who changed what in which revision?

UserRevisionLine numberNew 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 3:aca7fe2d44b3 9 #pragma once
karpent 1:4a5e329e617b 10
karpent 1:4a5e329e617b 11 #include <ArduinoGL.h>
karpent 2:ef3093a7a43e 12 #include "Model.h"
karpent 1:4a5e329e617b 13
karpent 1:4a5e329e617b 14 /**
karpent 1:4a5e329e617b 15 * @brief 3D model of the sphere
karpent 1:4a5e329e617b 16 */
karpent 2:ef3093a7a43e 17 class Sphere : public Model
karpent 1:4a5e329e617b 18 {
karpent 1:4a5e329e617b 19 public:
karpent 1:4a5e329e617b 20 Sphere(Display * display);
karpent 1:4a5e329e617b 21
karpent 1:4a5e329e617b 22 /**
karpent 1:4a5e329e617b 23 * @brief Model setup.
karpent 1:4a5e329e617b 24 * @retval None
karpent 1:4a5e329e617b 25 */
karpent 2:ef3093a7a43e 26 void virtual Setup();
karpent 1:4a5e329e617b 27
karpent 1:4a5e329e617b 28 /**
karpent 1:4a5e329e617b 29 * @brief Renders model for given view angle.
karpent 1:4a5e329e617b 30 * @param None
karpent 1:4a5e329e617b 31 * @retval None
karpent 1:4a5e329e617b 32 */
karpent 2:ef3093a7a43e 33 void virtual Render();
karpent 1:4a5e329e617b 34
karpent 1:4a5e329e617b 35 private:
karpent 1:4a5e329e617b 36
karpent 1:4a5e329e617b 37 void DrawModel(float radius, float p);
karpent 1:4a5e329e617b 38
karpent 1:4a5e329e617b 39 float _perspectiveAspect;
karpent 1:4a5e329e617b 40 };