Browse Source

Fixed viewing point in fullscreen mode

hutattedonmyarm 12 years ago
parent
commit
c71cfaeb4e
1 changed files with 15 additions and 3 deletions
  1. 15
    3
      CubeControl/Led3D.java

+ 15
- 3
CubeControl/Led3D.java View File

@@ -44,6 +44,8 @@ public class Led3D {
44 44
 	private BranchGroup group = null;
45 45
 	private Transform3D trans3D = null;
46 46
 	private TransformGroup transGroup = null;
47
+	private Matrix4d mat = null;
48
+	private Matrix4d fullScreenMat = null;
47 49
 
48 50
 	private Sphere[][][] leds = new Sphere[8][8][8];
49 51
 	private static ColoringAttributes redColor = new ColoringAttributes(
@@ -68,11 +70,19 @@ public class Led3D {
68 70
 		group = new BranchGroup();
69 71
 		// Position viewer, so we are looking at object
70 72
 		trans3D = new Transform3D();
71
-		Matrix4d mat = new Matrix4d();
73
+		mat = new Matrix4d();
72 74
 		mat.setRow(0, 0.744, 0.0237, -0.66756, -0.34);
73 75
 		mat.setRow(1, 0.136, -0.9837, 0.117, 3.24);
74 76
 		mat.setRow(2, -0.6536, -0.1785, -0.735, -8.32);
75 77
 		mat.setRow(3, 0.0, 0.0, 0.0, 1.0);
78
+
79
+		fullScreenMat = new Matrix4d();
80
+		fullScreenMat.setRow(0, 0.744, 0.0237, -0.66756, -0.34);
81
+		fullScreenMat.setRow(1, 0.136, -0.9837, 0.117, 3.24);
82
+		fullScreenMat.setRow(2, -0.6536, -0.1785, -0.735, -18.0);
83
+		fullScreenMat.setRow(3, 0.0, 0.0, 0.0, 1.0);
84
+
85
+
76 86
 		trans3D.set(mat);
77 87
 
78 88
 		transGroup = new TransformGroup(trans3D);
@@ -269,7 +279,8 @@ public class Led3D {
269 279
 		}
270 280
 		group.addChild(fullscreenBackground);
271 281
 		universe.addBranchGraph(group);
272
-		
282
+		trans3D.set(fullScreenMat);
283
+		transGroup.setTransform(trans3D);
273 284
 	}
274 285
 	
275 286
 	public void leaveFullscreen() {
@@ -280,6 +291,7 @@ public class Led3D {
280 291
 		background = createBackground();
281 292
 		group.addChild(background);
282 293
 		universe.addBranchGraph(group);
283
-		
294
+		trans3D.set(mat);
295
+		transGroup.setTransform(trans3D);
284 296
 	}
285 297
 }

Loading…
Cancel
Save