diff options
author | Steve <steveb9@u.washington.edu> | 2011-03-18 04:17:57 +0000 |
---|---|---|
committer | Steve <steveb9@u.washington.edu> | 2011-03-18 04:17:57 +0000 |
commit | 7bf857f863ee3ad28b239abd23694395e4eef051 (patch) | |
tree | 70aa0273006f1d3deddd2c209e3de38e58a6a6b8 /src/tesseract/objects/blimp/BlimpFin.java | |
parent | 7b363e5a0a4573dbe0469b3b9419f4cfd7e75e12 (diff) |
modified appearance structure of fin still not serialzing color
Diffstat (limited to 'src/tesseract/objects/blimp/BlimpFin.java')
-rw-r--r-- | src/tesseract/objects/blimp/BlimpFin.java | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/tesseract/objects/blimp/BlimpFin.java b/src/tesseract/objects/blimp/BlimpFin.java index 4de5b09..9d62bd8 100644 --- a/src/tesseract/objects/blimp/BlimpFin.java +++ b/src/tesseract/objects/blimp/BlimpFin.java @@ -8,6 +8,7 @@ package tesseract.objects.blimp; import javax.media.j3d.Appearance;
+import javax.media.j3d.ColoringAttributes;
import javax.media.j3d.Geometry;
import javax.media.j3d.ImageComponent2D;
import javax.media.j3d.Material;
@@ -45,11 +46,6 @@ public class BlimpFin extends PhysicalObject { public static final int DEFAULT_DIVISIONS = 4;
/**
- * The appearance of this fin
- */
- private Appearance my_appearance;
-
- /**
* Create a new Ellipsoid.
*
* @param position Initial position.
@@ -58,11 +54,9 @@ public class BlimpFin extends PhysicalObject { * @param divisions an in for the shape divisions.
*/
public BlimpFin( final float mass, final Vector3f position,
- final float radius, final Appearance appearance) {
+ final float radius) {
super(position, mass);
- my_appearance = appearance;
-
setShape(createShape(radius, DEFAULT_DIVISIONS));
/*if (inverseMass != 0) {
@@ -96,11 +90,14 @@ public class BlimpFin extends PhysicalObject { new NormalGenerator().generateNormals(gInfo);
gInfo.convertToIndexedTriangles();
Shape3D fin = new Shape3D(gInfo.getGeometryArray());
+ Appearance appearance = new Appearance();
+ appearance.setColoringAttributes(new ColoringAttributes(new Color3f(.1f,.1f,.3f),
+ ColoringAttributes.FASTEST));
PolygonAttributes polyAttr = new PolygonAttributes(PolygonAttributes.POLYGON_FILL, PolygonAttributes.CULL_NONE, 0);
- my_appearance.setPolygonAttributes(polyAttr);
+ appearance.setPolygonAttributes(polyAttr);
geometry.setCapability(Geometry.ALLOW_INTERSECT);
- fin = new Shape3D(geometry, my_appearance);
+ fin = new Shape3D(geometry, appearance);
Transform3D rotate = new Transform3D();
rotate.rotY(Math.PI / 4);
TransformGroup tg = new TransformGroup(rotate);
|