Explorar el Código

Set new rotationpoint for Cube

Felix Baeder hace 12 años
padre
commit
c7eec18292
Se han modificado 1 ficheros con 12 adiciones y 12 borrados
  1. 12
    12
      CubeControl/Led3D.java

+ 12
- 12
CubeControl/Led3D.java Ver fichero

75
 		// Position viewer, so we are looking at object
75
 		// Position viewer, so we are looking at object
76
 		trans3D = new Transform3D();
76
 		trans3D = new Transform3D();
77
 		mat = new Matrix4d();
77
 		mat = new Matrix4d();
78
-		mat.setRow(0, 0.744, 0.0237, -0.66756, -0.34);
79
-		mat.setRow(1, 0.136, -0.9837, 0.117, 3.24);
80
-		mat.setRow(2, -0.6536, -0.1785, -0.735, -8.32);
78
+		mat.setRow(0, 0.7597, -0.0204, 0.64926, 0.56);
79
+		mat.setRow(1, -0.08, -0.995, 0.061, 0.02);
80
+		mat.setRow(2, 0.64473, -0.09786, -0.758, -14.68);
81
 		mat.setRow(3, 0.0, 0.0, 0.0, 1.0);
81
 		mat.setRow(3, 0.0, 0.0, 0.0, 1.0);
82
 
82
 
83
 		fullScreenMat = new Matrix4d();
83
 		fullScreenMat = new Matrix4d();
84
-		fullScreenMat.setRow(0, 0.744, 0.0237, -0.66756, -0.34);
85
-		fullScreenMat.setRow(1, 0.136, -0.9837, 0.117, 3.24);
86
-		fullScreenMat.setRow(2, -0.6536, -0.1785, -0.735, -18.0);
84
+		fullScreenMat.setRow(0, 0.7597, -0.0204, 0.64926, 0.56);
85
+		fullScreenMat.setRow(1, -0.08, -0.995, 0.061, 0.02);
86
+		fullScreenMat.setRow(2, 0.64473, -0.09786, -0.758, -14.68);
87
 		fullScreenMat.setRow(3, 0.0, 0.0, 0.0, 1.0);
87
 		fullScreenMat.setRow(3, 0.0, 0.0, 0.0, 1.0);
88
 
88
 
89
 
89
 
133
 
133
 
134
 					TransformGroup tg = new TransformGroup();
134
 					TransformGroup tg = new TransformGroup();
135
 					Transform3D transform = new Transform3D();
135
 					Transform3D transform = new Transform3D();
136
-					Vector3f vector = new Vector3f(x, y, z);
136
+					Vector3f vector = new Vector3f(x - 4, y - 4, z - 4);
137
 					transform.setTranslation(vector);
137
 					transform.setTranslation(vector);
138
 					tg.setTransform(transform);
138
 					tg.setTransform(transform);
139
 					tg.addChild(leds[x][y][z]);
139
 					tg.addChild(leds[x][y][z]);
140
 					transGroup.addChild(tg);
140
 					transGroup.addChild(tg);
141
 
141
 
142
-					drawLedFeetVertical((double) x, y + 0.5, (double) z, 0.9f, 0.01f);
142
+					drawLedFeetVertical((double) x - 4, y - 3.5, (double) z-4, 0.9f, 0.01f);
143
 					if (x < 7)
143
 					if (x < 7)
144
-						drawLedFeetHorizontal(x + 0.5, (double) y, (double) z, 0.9f, 0.01f, 0);
144
+						drawLedFeetHorizontal(x - 3.5, (double) y - 4, (double) z - 4, 0.9f, 0.01f, 0);
145
 				}
145
 				}
146
 			}
146
 			}
147
 			// 8 times, use x as y
147
 			// 8 times, use x as y
148
-			drawLedFeetHorizontal(0.5, (double) x, 3.5, 7.0f, 0.02f, 90);
149
-			drawLedFeetHorizontal(6.5, (double) x, 3.5, 7.0f, 0.02f, 90);
150
-			drawLedFeetHorizontal(3.5, (double) x, 3.5, 7.0f, 0.02f, 90);
148
+			drawLedFeetHorizontal(-3.5, (double) x-4, 3.5, 7.0f, 0.02f, 90);
149
+			drawLedFeetHorizontal(2.5, (double) x-4, 3.5, 7.0f, 0.02f, 90);
150
+			drawLedFeetHorizontal(-1.5, (double) x-4, 3.5, 7.0f, 0.02f, 90);
151
 		}
151
 		}
152
 
152
 
153
 		// Add an ambient light
153
 		// Add an ambient light

Loading…
Cancelar
Guardar