-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsphere.h
More file actions
39 lines (31 loc) · 741 Bytes
/
sphere.h
File metadata and controls
39 lines (31 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* sphere.h
Example class to create a generic sphere object
Resolution can be controlled by settign nuber of latitudes and longitudes
Iain Martin November 2016
*/
#pragma once
#include "wrapper_glfw.h"
#include <vector>
#include <glm/glm.hpp>
class Sphere
{
public:
Sphere();
~Sphere();
void makeSphere(GLuint numlats, GLuint numlongs);
void drawSphere(int drawmode);
private:
// Define vertex buffer object names (e.g as globals)
GLuint sphereBufferObject;
GLuint sphereNormals;
GLuint sphereColours;
GLuint elementbuffer;
GLuint attribute_v_coord;
GLuint attribute_v_normal;
GLuint attribute_v_colours;
int numspherevertices;
int numlats;
int numlongs;
int drawmode;
void makeUnitSphere(GLfloat *pVertices);
};