Browse Source

Fixed legs not rotating while not being displayed

Max Nuding 12 years ago
parent
commit
83e0493c4c
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      CubeControl/Led3D.java

+ 7
- 2
CubeControl/Led3D.java View File

65
 			new Color3f(1.0f, 0.0f, 0.0f), new Color3f(1.0f, 0.0f, 0.0f),
65
 			new Color3f(1.0f, 0.0f, 0.0f), new Color3f(1.0f, 0.0f, 0.0f),
66
 			new Color3f(1.0f, 0.0f, 0.0f), new Color3f(1.0f, 0.0f, 0.0f), 64.0f);
66
 			new Color3f(1.0f, 0.0f, 0.0f), new Color3f(1.0f, 0.0f, 0.0f), 64.0f);
67
 	private Background background;
67
 	private Background background;
68
+	private	Appearance feetApp = new Appearance();
68
 
69
 
69
 	
70
 	
70
 	public void toggleLegs(){
71
 	public void toggleLegs(){
72
 			group2.detach();
73
 			group2.detach();
73
 		} else {
74
 		} else {
74
 			universe.addBranchGraph(group2);
75
 			universe.addBranchGraph(group2);
76
+			Transform3D t = new Transform3D();
77
+			transGroup.getTransform(t);
78
+			feetGroup.setTransform(t);
79
+
75
 		}
80
 		}
76
 		showLegs = !showLegs;
81
 		showLegs = !showLegs;
77
 	}
82
 	}
265
 	private void drawLedFeetVertical(double x, double y, double z,
270
 	private void drawLedFeetVertical(double x, double y, double z,
266
 			float length, float rad) {
271
 			float length, float rad) {
267
 		// draw Feet going down
272
 		// draw Feet going down
268
-		Appearance feetApp = new Appearance();
273
+		
269
 		feetApp.setMaterial(whiteMat);
274
 		feetApp.setMaterial(whiteMat);
270
 		feetApp.setColoringAttributes(whiteColor);
275
 		feetApp.setColoringAttributes(whiteColor);
271
 		Cylinder c = new Cylinder(rad, length, feetApp);
276
 		Cylinder c = new Cylinder(rad, length, feetApp);
283
 	private void drawLedFeetHorizontal(double x, double y, double z,
288
 	private void drawLedFeetHorizontal(double x, double y, double z,
284
 			float length, float rad, int deg) {
289
 			float length, float rad, int deg) {
285
 		// draw Feet going down
290
 		// draw Feet going down
286
-		Appearance feetApp = new Appearance();
291
+	
287
 		feetApp.setMaterial(whiteMat);
292
 		feetApp.setMaterial(whiteMat);
288
 		feetApp.setColoringAttributes(whiteColor);
293
 		feetApp.setColoringAttributes(whiteColor);
289
 		Cylinder c = new Cylinder(rad, length, feetApp);
294
 		Cylinder c = new Cylinder(rad, length, feetApp);

Loading…
Cancel
Save