Browse Source

Set new rotationpoint for Cube

Felix Baeder 12 years ago
parent
commit
c7eec18292
1 changed files with 12 additions and 12 deletions
  1. 12
    12
      CubeControl/Led3D.java

+ 12
- 12
CubeControl/Led3D.java View File

@@ -75,15 +75,15 @@ public class Led3D extends MouseAdapter {
75 75
 		// Position viewer, so we are looking at object
76 76
 		trans3D = new Transform3D();
77 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 81
 		mat.setRow(3, 0.0, 0.0, 0.0, 1.0);
82 82
 
83 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 87
 		fullScreenMat.setRow(3, 0.0, 0.0, 0.0, 1.0);
88 88
 
89 89
 
@@ -133,21 +133,21 @@ public class Led3D extends MouseAdapter {
133 133
 
134 134
 					TransformGroup tg = new TransformGroup();
135 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 137
 					transform.setTranslation(vector);
138 138
 					tg.setTransform(transform);
139 139
 					tg.addChild(leds[x][y][z]);
140 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 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 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 153
 		// Add an ambient light

Loading…
Cancel
Save