Browse Source

Fixed viewing point in fullscreen mode

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

Loading…
Cancel
Save