-
Notifications
You must be signed in to change notification settings - Fork 0
/
vxOpenGlTools.cpp
61 lines (47 loc) · 1.07 KB
/
vxOpenGlTools.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
/**
*
* file vxOpenGlTools.cpp
*
* This source file is a part of VoxelBrain software.
*
* (c) Nanyang Technological University
*
* Author: Konstantin Levinski
*
*/
#include "vxOpenGlTools.h"
/*
Conviniences.
*/
const V3f & glColor3f(const V3f & v){
glColor4f(v.x, v.y, v.z, 0.2); return v;
};
const V3f & glVertex3f(const V3f & v){
glVertex3f(v.x, v.y, v.z); return v;
};
const V3f & glNormal3f(const V3f & v){
glNormal3f(v.x, v.y, v.z); return v;
};
const V3f & glTexCoord3f(const V3f & v){
glTexCoord3f(v.x, v.y, v.z); return v;
};
const V3f & SetColor(const V3f & v){
glColor3f(v.x, v.y, v.z); return v;
};
const V3f & glTranslatef(const V3f & v){
glTranslatef(v.x, v.y, v.z); return v;
};
const V3f & glScalef(const V3f & v){
glScalef(v.x, v.y, v.z); return v;
};
void TransparencyStart(){
glEnable(GL_BLEND);
glDisable(GL_LIGHTING);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(1.0f, 0.0f, 0.0f, 0.5f);
};
void TransparencyEnd(){
glDisable(GL_BLEND);
glEnable(GL_LIGHTING);
};
// End of vxOpenGlTools.cpp