-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScreenDrawers.pde
More file actions
92 lines (78 loc) · 2.84 KB
/
Copy pathScreenDrawers.pde
File metadata and controls
92 lines (78 loc) · 2.84 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
The methods for drawing the different screens.
*/
//Screen that shows when application is launched, user clicks a button to open filechoosers to find clouds.
void drawOpenScreen(){
laodcloud1button.draw();
laodcloud2button.draw();
viewcloud1button.draw();
viewcloud2button.draw();
if(cloud1PointsList.size()>2 && cloud2PointsList.size()>2){
transformCloudButton.draw();
}
if(transCloud!=null){
viewBigCloudButton.draw();
printFileButton.draw();
}
if(cloud1PointsList.size()!=0 || cloud2PointsList.size()!=0){
resetRegistrationButton.draw();
}
}
void drawCloudOne(){
//Get GL object to make direct OpenGL calls
PGraphicsOpenGL pgl = (PGraphicsOpenGL) g;
gl = pgl.beginGL();
gl.glPointSize(pointSize); //default is 1
gl.glColor4f(0.6f,0.5f,0.6f,0.6f);
gl.glEnableClientState(GL.GL_VERTEX_ARRAY);
gl.glVertexPointer(3, GL.GL_FLOAT, 0, f1); //define an array of vertex data, gets points from FloatBuffer f
gl.glDrawArrays(GL.GL_POINTS, 0, f1.capacity()/3);
gl.glDisableClientState(GL.GL_VERTEX_ARRAY);
pgl.endGL();
frame.setTitle("Cloud "+ currentScreen+ ", registered " + cloud1PointsList.size() + " points.");
}
void drawCloudTwo(){
//Get GL object to make direct OpenGL calls
PGraphicsOpenGL pgl2 = (PGraphicsOpenGL) g;
gl2 = pgl2.beginGL();
gl2.glPointSize(pointSize);
gl2.glColor4f(0.6f,0.6f,0.5f,0.6f);
gl2.glEnableClientState(GL.GL_VERTEX_ARRAY);
gl2.glVertexPointer(3, GL.GL_FLOAT, 0, f2); //define an array of vertex data, gets points from FloatBuffer f
gl2.glDrawArrays(GL.GL_POINTS, 0, f2.capacity()/3);
gl2.glDisableClientState(GL.GL_VERTEX_ARRAY);
pgl2.endGL();
frame.setTitle("Cloud "+ currentScreen+ ", registered " + cloud2PointsList.size() + " points.");
}
void drawBigCloud(){
//Get GL object to make direct OpenGL calls
PGraphicsOpenGL pgl2 = (PGraphicsOpenGL) g;
gl2 = pgl2.beginGL();
gl2.glPointSize(pointSize);
gl2.glColor4f(0.6f,0.6f,0.5f,0.6f);
gl2.glEnableClientState(GL.GL_VERTEX_ARRAY);
gl2.glVertexPointer(3, GL.GL_FLOAT, 0, f2); //define an array of vertex data, gets points from FloatBuffer f
gl2.glDrawArrays(GL.GL_POINTS, 0, f2.capacity()/3);
gl2.glDisableClientState(GL.GL_VERTEX_ARRAY);
gl2.glColor4f(0.8f,0.6f,0.6f,0.6f);
gl2.glEnableClientState(GL.GL_VERTEX_ARRAY);
gl2.glVertexPointer(3, GL.GL_FLOAT, 0, f3); //define an array of vertex data, gets points from FloatBuffer f
gl2.glDrawArrays(GL.GL_POINTS, 0, f3.capacity()/3);
gl2.glDisableClientState(GL.GL_VERTEX_ARRAY);
pgl2.endGL();
frame.setTitle("KinectCloud - Merged cloud");
}
void shouldCameraBeOn(){
if(currentScreen == 0){
camera();
cameraOn = false;
}
else{
if(cameraOn == false){
camera1 = new PeasyCam(this,00,00,00, 500);
camera1.setWheelScale(1);
camera1.setMinimumDistance(10);
cameraOn = true;
}
}
}