-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathland.cpp
66 lines (50 loc) · 1.16 KB
/
land.cpp
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: land.cpp
* Author: deboramorita
*
* Created on March 23, 2017, 2:17 AM
*/
#ifdef __APPLE__
#include <OpenGL/OpenGL.h>
#include <GLUT/glut.h>
#else
#include <GL/gl.h>
#include <GL/glut.h>
#endif
#include "land.h"
Land::Land() {
this->material = Material::yellow;
}
Land::~Land() {
}
void Land::draw() {
glPushMatrix();
this->material.apply();
for (float i = -50; i <= 15; i += 5) {
// Start drawing some lines
glBegin(GL_LINES);
// Do the horizontal lines (along the X)
glVertex3f(-50, 0, i);
glVertex3f(50, 0, i);
// Stop drawing lines
glEnd();
}
for (float i = -50; i <= 50; i += 5) {
// Start drawing some lines
glBegin(GL_LINES);
// Do the vertical lines (along the Z)
glVertex3f(i, 0, -50);
glVertex3f(i, 0, 15);
// Stop drawing lines
glEnd();
}
glEnd();
glPopMatrix();
}
void Land::idle() {
}