-
Notifications
You must be signed in to change notification settings - Fork 0
/
NA_HeatLamp.cpp
52 lines (34 loc) · 978 Bytes
/
NA_HeatLamp.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
#include "stdafx.h"
#include "NA_HeatLamp.h"
NA_HeatLamp::NA_HeatLamp()
{
radius = 12;
heat = 12;
}
NA_HeatLamp::~NA_HeatLamp()
{
}
void NA_HeatLamp::draw()
{
glPushMatrix();
// fixes heat lamp getting textures from previous
glActiveTexture(GL_TEXTURE0);
glDisable(GL_TEXTURE_2D);
glUseProgram(0);
glLoadIdentity();
glTranslatef(pos.x, pos.y, pos.z);
glutSolidSphere(radius, 15, 2);
extern cRenderClass graphics;
glPopMatrix();
//http://www.glprogramming.com/red/chapter05.html
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat mat_shininess[] = { 50.0 };
GLfloat light0_position[] = { pos.x , pos.y, pos.z, 0.0 };
glClearColor(0.0, 0.0, 0.0, 1.0);
glShadeModel(GL_SMOOTH);
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
glLightfv(GL_LIGHT0, GL_POSITION, light0_position);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
}