changeset 5875:79f9671ee7dc

Ensemble8: RT-34639 Fix 3D samples
author Alexander Kouznetsov
date Mon, 02 Dec 2013 20:08:13 -0800
parents 0e725e5d052d
children 2ae4bdb4a966
files apps/samples/Ensemble8/src/generated/java/ensemble/generated/Samples.java apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics3d/cube/Cube.java apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics3d/cube/CubeApp.java apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics3d/cubesystem/CubeSystemApp.java apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics3d/cubesystem/SphereSystemApp.java apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics3d/cubesystem/Xsphere.java apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics3d/simple3dbox/Simple3DBoxApp.java apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics3d/xylophone/XylophoneApp.java
diffstat 8 files changed, 306 insertions(+), 312 deletions(-) [+]
line wrap: on
line diff
--- a/apps/samples/Ensemble8/src/generated/java/ensemble/generated/Samples.java	Mon Dec 02 19:11:39 2013 -0800
+++ b/apps/samples/Ensemble8/src/generated/java/ensemble/generated/Samples.java	Mon Dec 02 20:08:13 2013 -0800
@@ -103,8 +103,8 @@
     private static final SampleInfo SAMPLE_96 = new SampleInfo("Quad Curve","An example of how various settings affect a quadratic B├ęzier parametric curve. ","/Graphics/Shapes/Quad Curve","/ensemble/samples/graphics/shapes/quadcurve","ensemble.samples.graphics.shapes.quadcurve.QuadCurveApp","/ensemble/samples/graphics/shapes/quadcurve/preview.png",new String[]{"/ensemble/samples/graphics/shapes/quadcurve/QuadCurveApp.java",},new String[]{"javafx.scene.shape.QuadCurve","javafx.scene.shape.Shape","javafx.scene.paint.Color",},new String[]{},new String[]{},"/ensemble/samples/graphics/shapes/quadcurve/QuadCurveApp.java",new PlaygroundProperty[]{new PlaygroundProperty("quadCurve","fill","name","Cubic Curve Fill"),new PlaygroundProperty("quadCurve","stroke","name","Cubic Curve Stroke"),new PlaygroundProperty("quadCurve","startX","min","0","max","170","name","Cubic Curve Start X"),new PlaygroundProperty("quadCurve","startY","min","10","max","80","name","Cubic Curve Start Y"),new PlaygroundProperty("quadCurve","controlX","min","0","max","180","name","Cubic Curve Control X"),new PlaygroundProperty("quadCurve","controlY","min","0","max","90","name","Cubic Curve Control Y"),new PlaygroundProperty("quadCurve","endX","min","10","max","180","name","Cubic Curve End X"),new PlaygroundProperty("quadCurve","endY","min","10","max","80","name","Cubic Curve End Y"),},new ConditionalFeature[]{},true);
     private static final SampleInfo SAMPLE_97 = new SampleInfo("Rectangle","A sample showing how various settings effect two rectangles. ","/Graphics/Shapes/Rectangle","/ensemble/samples/graphics/shapes/rectangle","ensemble.samples.graphics.shapes.rectangle.RectangleApp","/ensemble/samples/graphics/shapes/rectangle/preview.png",new String[]{"/ensemble/samples/graphics/shapes/rectangle/RectangleApp.java",},new String[]{"javafx.scene.shape.Rectangle","javafx.scene.shape.Shape","javafx.scene.paint.Color",},new String[]{},new String[]{},"/ensemble/samples/graphics/shapes/rectangle/RectangleApp.java",new PlaygroundProperty[]{new PlaygroundProperty("rect1","fill","name","Rectangle 1 Fill"),new PlaygroundProperty("rect1","width","min","10","max","50","name","Rectangle 1 Width"),new PlaygroundProperty("rect1","height","min","10","max","50","name","Rectangle 1 Height"),new PlaygroundProperty("rect1","arcWidth","min","0","max","50","name","Rectangle 1 Arc Width"),new PlaygroundProperty("rect1","arcHeight","min","0","max","50","name","Rectangle 1 Arc Height"),new PlaygroundProperty("rect2","stroke","name","Rectangle 2 Stroke"),new PlaygroundProperty("rect2","strokeWidth","min","1","max","5","name","Rectangle 2 Stroke Width"),new PlaygroundProperty("rect2","width","min","10","max","50","name","Rectangle 2 Width"),new PlaygroundProperty("rect2","height","min","10","max","50","name","Rectangle 2 Height"),new PlaygroundProperty("rect2","arcWidth","min","0","max","50","name","Rectangle 2 Arc Width"),new PlaygroundProperty("rect2","arcHeight","min","0","max","50","name","Rectangle 2 Arc Height"),},new ConditionalFeature[]{},true);
     private static final SampleInfo SAMPLE_98 = new SampleInfo("3D Cubes","A sample that demonstrates an animated rotation of 3D cubes. ","/Graphics 3d/3D Cubes","/ensemble/samples/graphics3d/cube","ensemble.samples.graphics3d.cube.CubeApp","/ensemble/samples/graphics3d/cube/preview.png",new String[]{"/ensemble/samples/graphics3d/cube/Cube.java","/ensemble/samples/graphics3d/cube/CubeApp.java",},new String[]{"javafx.scene.PerspectiveCamera","javafx.scene.SubScene","javafx.scene.paint.Color","javafx.scene.transform.Rotate","javafx.scene.transform.Translate",},new String[]{},new String[]{},"/ensemble/samples/graphics3d/cube/CubeApp.java",new PlaygroundProperty[]{},new ConditionalFeature[]{ConditionalFeature.SCENE3D,},false);
-    private static final SampleInfo SAMPLE_99 = new SampleInfo("3D Cube System","A sample that demonstrates an animated rotation of 3D cubes. When the application runs in standalone mode, the scene must be constructed with the depthBuffer argument set to true, and the root node must have depthTest set to true. ","/Graphics 3d/3D Cube System","/ensemble/samples/graphics3d/cubesystem","ensemble.samples.graphics3d.cubesystem.CubeSystemApp","/ensemble/samples/graphics3d/cubesystem/preview.png",new String[]{"/ensemble/samples/graphics3d/cubesystem/Cube.java","/ensemble/samples/graphics3d/cubesystem/CubeSystemApp.java","/ensemble/samples/graphics3d/cubesystem/Xform.java",},new String[]{"javafx.scene.transform.Rotate","javafx.scene.paint.Color",},new String[]{},new String[]{},"/ensemble/samples/graphics3d/cubesystem/CubeSystemApp.java",new PlaygroundProperty[]{},new ConditionalFeature[]{ConditionalFeature.SCENE3D,},false);
-    private static final SampleInfo SAMPLE_100 = new SampleInfo("3D Box","A sample that shows a 3D box and uses a perspective camera for rendering the scene. ","/Graphics 3d/3D Box","/ensemble/samples/graphics3d/simple3dbox","ensemble.samples.graphics3d.simple3dbox.Simple3DBoxApp","/ensemble/samples/graphics3d/simple3dbox/preview.png",new String[]{"/ensemble/samples/graphics3d/simple3dbox/Simple3DBoxApp.java",},new String[]{"javafx.scene.paint.Color","javafx.scene.transform.Rotate","javafx.scene.transform.Translate",},new String[]{},new String[]{},"/ensemble/samples/graphics3d/simple3dbox/Simple3DBoxApp.java",new PlaygroundProperty[]{},new ConditionalFeature[]{ConditionalFeature.SCENE3D,},false);
+    private static final SampleInfo SAMPLE_99 = new SampleInfo("3D Sphere System","A sample that demonstrates an animated rotation of 3D spheres. ","/Graphics 3d/3D Sphere System","/ensemble/samples/graphics3d/cubesystem","ensemble.samples.graphics3d.cubesystem.SphereSystemApp","/ensemble/samples/graphics3d/cubesystem/preview.png",new String[]{"/ensemble/samples/graphics3d/cubesystem/SphereSystemApp.java","/ensemble/samples/graphics3d/cubesystem/Xform.java","/ensemble/samples/graphics3d/cubesystem/Xsphere.java",},new String[]{"javafx.scene.transform.Rotate","javafx.scene.paint.Color",},new String[]{},new String[]{},"/ensemble/samples/graphics3d/cubesystem/SphereSystemApp.java",new PlaygroundProperty[]{},new ConditionalFeature[]{ConditionalFeature.SCENE3D,},false);
+    private static final SampleInfo SAMPLE_100 = new SampleInfo("3D Box","A sample that shows a 3D box and uses a perspective camera for rendering the scene. Hint: Switch to Line draw mode to see how cullFace property works. ","/Graphics 3d/3D Box","/ensemble/samples/graphics3d/simple3dbox","ensemble.samples.graphics3d.simple3dbox.Simple3DBoxApp","/ensemble/samples/graphics3d/simple3dbox/preview.png",new String[]{"/ensemble/samples/graphics3d/simple3dbox/Simple3DBoxApp.java",},new String[]{"javafx.scene.shape.Box","javafx.scene.PerspectiveCamera","javafx.scene.paint.PhongMaterial","javafx.scene.paint.Color","javafx.scene.transform.Rotate","javafx.scene.transform.Translate","javafx.scene.SceneAntialiasing","javafx.scene.SubScene",},new String[]{},new String[]{},"/ensemble/samples/graphics3d/simple3dbox/Simple3DBoxApp.java",new PlaygroundProperty[]{new PlaygroundProperty("testBox","drawMode"),new PlaygroundProperty("testBox","cullFace"),new PlaygroundProperty("material","diffuseColor"),},new ConditionalFeature[]{ConditionalFeature.SCENE3D,},false);
     private static final SampleInfo SAMPLE_101 = new SampleInfo("Xylophone","A sample that demonstrates a xylophone made of 3D cubes. It is animated and plays sounds when clicked. ","/Graphics 3d/Xylophone","/ensemble/samples/graphics3d/xylophone","ensemble.samples.graphics3d.xylophone.XylophoneApp","/ensemble/samples/graphics3d/xylophone/preview.png",new String[]{"/ensemble/samples/graphics3d/xylophone/Xform.java","/ensemble/samples/shared-resources/Note1.wav","/ensemble/samples/shared-resources/Note2.wav","/ensemble/samples/shared-resources/Note3.wav","/ensemble/samples/shared-resources/Note4.wav","/ensemble/samples/shared-resources/Note5.wav","/ensemble/samples/shared-resources/Note6.wav","/ensemble/samples/shared-resources/Note7.wav","/ensemble/samples/shared-resources/Note8.wav","/ensemble/samples/graphics3d/xylophone/XylophoneApp.java",},new String[]{"javafx.scene.shape.Box","javafx.scene.paint.PhongMaterial","javafx.scene.media.AudioClip","javafx.scene.PerspectiveCamera","javafx.scene.transform.Rotate","javafx.scene.transform.Scale","javafx.animation.Timeline","javafx.animation.KeyFrame","javafx.animation.KeyValue","javafx.animation.Interpolator","javafx.scene.input.MouseEvent","javafx.event.EventHandler","javafx.util.Duration","javafx.scene.Group","javafx.scene.SceneAntialiasing","javafx.scene.SubScene",},new String[]{},new String[]{},"/ensemble/samples/graphics3d/xylophone/XylophoneApp.java",new PlaygroundProperty[]{},new ConditionalFeature[]{ConditionalFeature.SCENE3D,},false);
     private static final SampleInfo SAMPLE_102 = new SampleInfo("ChangeListener","A sample that demonstrates how to add or remove a change listener on a node (for example, a Rectangle node) for some property (for example, Rectangle.hover). Once you add a listener, the text field  shows the hover property change. ","/Language/Beans/ChangeListener","/ensemble/samples/language/beans/changelistener","ensemble.samples.language.beans.changelistener.ChangeListenerApp","/ensemble/samples/language/beans/changelistener/preview.png",new String[]{"/ensemble/samples/language/beans/changelistener/ChangeListenerApp.java",},new String[]{"javafx.beans.value.ChangeListener","javafx.beans.InvalidationListener","javafx.beans.value.ObservableValue",},new String[]{},new String[]{},"/ensemble/samples/language/beans/changelistener/ChangeListenerApp.java",new PlaygroundProperty[]{},new ConditionalFeature[]{},true);
     private static final SampleInfo SAMPLE_103 = new SampleInfo("String Binding","A sample that demonstrates how to bind text properties so the value of the bound property is updated automatically when the value of the original property is changed. ","/Language/Beans/String Binding","/ensemble/samples/language/beans/stringbinding","ensemble.samples.language.beans.stringbinding.StringBindingApp","/ensemble/samples/language/beans/stringbinding/preview.png",new String[]{"/ensemble/samples/language/beans/stringbinding/StringBindingApp.java",},new String[]{"javafx.beans.binding.StringBinding","javafx.scene.control.TextField","javafx.scene.control.Label",},new String[]{},new String[]{},"/ensemble/samples/language/beans/stringbinding/StringBindingApp.java",new PlaygroundProperty[]{},new ConditionalFeature[]{},true);
@@ -179,7 +179,7 @@
         DOCS_URL_TO_SAMPLE.put("javafx.scene.chart.PieChart",new SampleInfo[]{SAMPLE_29,SAMPLE_28,});
         DOCS_URL_TO_SAMPLE.put("javafx.scene.chart.BubbleChart",new SampleInfo[]{SAMPLE_23,});
         DOCS_URL_TO_SAMPLE.put("javafx.animation.Interpolator",new SampleInfo[]{SAMPLE_68,SAMPLE_101,SAMPLE_0,SAMPLE_121,});
-        DOCS_URL_TO_SAMPLE.put("javafx.scene.paint.PhongMaterial",new SampleInfo[]{SAMPLE_101,});
+        DOCS_URL_TO_SAMPLE.put("javafx.scene.paint.PhongMaterial",new SampleInfo[]{SAMPLE_101,SAMPLE_100,});
         DOCS_URL_TO_SAMPLE.put("javafx.scene.layout.FlowPane",new SampleInfo[]{SAMPLE_107,});
         DOCS_URL_TO_SAMPLE.put("javafx.scene.layout.TilePane",new SampleInfo[]{SAMPLE_111,});
         DOCS_URL_TO_SAMPLE.put("javafx.scene.media.AudioSpectrumListener",new SampleInfo[]{SAMPLE_18,SAMPLE_14,});
@@ -188,7 +188,7 @@
         DOCS_URL_TO_SAMPLE.put("javafx.collections.ObservableList",new SampleInfo[]{SAMPLE_119,SAMPLE_105,SAMPLE_104,SAMPLE_69,});
         DOCS_URL_TO_SAMPLE.put("javafx.scene.layout.BorderPane",new SampleInfo[]{SAMPLE_106,});
         DOCS_URL_TO_SAMPLE.put("javafx.scene.control.Hyperlink",new SampleInfo[]{SAMPLE_39,});
-        DOCS_URL_TO_SAMPLE.put("javafx.scene.SubScene",new SampleInfo[]{SAMPLE_101,SAMPLE_98,});
+        DOCS_URL_TO_SAMPLE.put("javafx.scene.SubScene",new SampleInfo[]{SAMPLE_101,SAMPLE_100,SAMPLE_98,});
         DOCS_URL_TO_SAMPLE.put("javafx.scene.shape.Path",new SampleInfo[]{SAMPLE_93,SAMPLE_75,});
         DOCS_URL_TO_SAMPLE.put("javafx.scene.control.cell.TextFieldTreeTableCell",new SampleInfo[]{SAMPLE_47,});
         DOCS_URL_TO_SAMPLE.put("javafx.scene.shape.CubicCurve",new SampleInfo[]{SAMPLE_90,});
@@ -198,7 +198,7 @@
         DOCS_URL_TO_SAMPLE.put("javafx.collections.FXCollections",new SampleInfo[]{SAMPLE_104,SAMPLE_33,SAMPLE_32,});
         DOCS_URL_TO_SAMPLE.put("javafx.scene.text.TextFlow",new SampleInfo[]{SAMPLE_129,SAMPLE_130,});
         DOCS_URL_TO_SAMPLE.put("java.util.ArrayList",new SampleInfo[]{SAMPLE_68,});
-        DOCS_URL_TO_SAMPLE.put("javafx.scene.PerspectiveCamera",new SampleInfo[]{SAMPLE_101,SAMPLE_98,});
+        DOCS_URL_TO_SAMPLE.put("javafx.scene.PerspectiveCamera",new SampleInfo[]{SAMPLE_101,SAMPLE_100,SAMPLE_98,});
         DOCS_URL_TO_SAMPLE.put("javafx.scene.control.TreeTableView",new SampleInfo[]{SAMPLE_47,});
         DOCS_URL_TO_SAMPLE.put("javafx.animation.FadeTransition",new SampleInfo[]{SAMPLE_3,});
         DOCS_URL_TO_SAMPLE.put("javafx.scene.control.ProgressBar",new SampleInfo[]{SAMPLE_42,});
@@ -271,7 +271,7 @@
         DOCS_URL_TO_SAMPLE.put("javafx.scene.effect.Effect",new SampleInfo[]{SAMPLE_81,SAMPLE_80,SAMPLE_79,SAMPLE_78,SAMPLE_77,});
         DOCS_URL_TO_SAMPLE.put("javafx.scene.media.Media",new SampleInfo[]{SAMPLE_18,SAMPLE_116,SAMPLE_14,SAMPLE_117,SAMPLE_114,SAMPLE_113,});
         DOCS_URL_TO_SAMPLE.put("javafx.scene.text.TextBoundsType",new SampleInfo[]{SAMPLE_76,});
-        DOCS_URL_TO_SAMPLE.put("javafx.scene.SceneAntialiasing",new SampleInfo[]{SAMPLE_101,});
+        DOCS_URL_TO_SAMPLE.put("javafx.scene.SceneAntialiasing",new SampleInfo[]{SAMPLE_101,SAMPLE_100,});
         DOCS_URL_TO_SAMPLE.put("javafx.scene.control.Pagination",new SampleInfo[]{SAMPLE_41,});
         DOCS_URL_TO_SAMPLE.put("javafx.scene.shape.QuadCurve",new SampleInfo[]{SAMPLE_96,});
         DOCS_URL_TO_SAMPLE.put("javafx.scene.Scene",new SampleInfo[]{SAMPLE_70,SAMPLE_127,SAMPLE_126,SAMPLE_128,SAMPLE_68,});
@@ -316,7 +316,7 @@
         DOCS_URL_TO_SAMPLE.put("javafx.scene.shape.HLineTo",new SampleInfo[]{SAMPLE_93,});
         DOCS_URL_TO_SAMPLE.put("javafx.animation.ParallelTransition",new SampleInfo[]{SAMPLE_5,});
         DOCS_URL_TO_SAMPLE.put("javafx.scene.control.TreeTableColumn",new SampleInfo[]{SAMPLE_47,});
-        DOCS_URL_TO_SAMPLE.put("javafx.scene.shape.Box",new SampleInfo[]{SAMPLE_101,});
+        DOCS_URL_TO_SAMPLE.put("javafx.scene.shape.Box",new SampleInfo[]{SAMPLE_101,SAMPLE_100,});
         DOCS_URL_TO_SAMPLE.put("javafx.event.ActionEvent",new SampleInfo[]{SAMPLE_68,SAMPLE_2,});
         DOCS_URL_TO_SAMPLE.put("javafx.stage.Stage",new SampleInfo[]{SAMPLE_70,SAMPLE_127,SAMPLE_126,SAMPLE_128,SAMPLE_68,SAMPLE_67,});
         DOCS_URL_TO_SAMPLE.put("javafx.scene.web.HTMLEditor",new SampleInfo[]{SAMPLE_131,});
--- a/apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics3d/cube/Cube.java	Mon Dec 02 19:11:39 2013 -0800
+++ b/apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics3d/cube/Cube.java	Mon Dec 02 20:08:13 2013 -0800
@@ -31,54 +31,20 @@
  */
 package ensemble.samples.graphics3d.cube;
 
-import javafx.scene.Group;
 import javafx.scene.paint.Color;
-import javafx.scene.shape.Rectangle;
+import javafx.scene.paint.PhongMaterial;
+import javafx.scene.shape.Box;
 import javafx.scene.transform.Rotate;
 
-public class Cube extends Group {
+public class Cube extends Box {
 
     final Rotate rx = new Rotate(0, Rotate.X_AXIS);
     final Rotate ry = new Rotate(0, Rotate.Y_AXIS);
     final Rotate rz = new Rotate(0, Rotate.Z_AXIS);
 
-    public Cube(double size, Color color, double shade) {
+    public Cube(double size, Color color) {
+        super(size, size, size);
+        setMaterial(new PhongMaterial(color));
         getTransforms().addAll(rz, ry, rx);
-        // back face
-        Rectangle rec1 = new Rectangle(size, size, color.deriveColor(0.0, 1.0, (1 - 0.5 * shade), 1.0));
-        rec1.setTranslateX(-0.5 * size);
-        rec1.setTranslateY(-0.5 * size);
-        rec1.setTranslateZ(0.5 * size);
-        // bottom face
-        Rectangle rec2 = new Rectangle(size, size, color.deriveColor(0.0, 1.0, (1 - 0.4 * shade), 1.0));
-        rec2.setTranslateX(-0.5 * size);
-        rec2.setTranslateY(0);
-        rec2.setRotationAxis(Rotate.X_AXIS);
-        rec2.setRotate(90);
-        // right face
-        Rectangle rec3 = new Rectangle(size, size, color.deriveColor(0.0, 1.0, (1 - 0.3 * shade), 1.0));
-        rec3.setTranslateX(-1 * size);
-        rec3.setTranslateY(-0.5 * size);
-        rec3.setRotationAxis(Rotate.Y_AXIS);
-        rec3.setRotate(90);
-        // left face
-        Rectangle rec4 = new Rectangle(size, size, color.deriveColor(0.0, 1.0, (1 - 0.2 * shade), 1.0));
-        rec4.setTranslateX(0);
-        rec4.setTranslateY(-0.5 * size);
-        rec4.setRotationAxis(Rotate.Y_AXIS);
-        rec4.setRotate(90);
-        // top face
-        Rectangle rec5 = new Rectangle(size, size, color.deriveColor(0.0, 1.0, (1 - 0.1 * shade), 1.0));
-        rec5.setTranslateX(-0.5 * size);
-        rec5.setTranslateY(-1 * size);
-        rec5.setRotationAxis(Rotate.X_AXIS);
-        rec5.setRotate(90);
-        // front face         
-        Rectangle rec6 = new Rectangle(size, size, color);
-        rec6.setTranslateX(-0.5 * size);
-        rec6.setTranslateY(-0.5 * size);
-        rec6.setTranslateZ(-0.5 * size);       
- 
-        getChildren().addAll(rec1, rec2, rec3, rec4, rec5, rec6);
     }
 }
--- a/apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics3d/cube/CubeApp.java	Mon Dec 02 19:11:39 2013 -0800
+++ b/apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics3d/cube/CubeApp.java	Mon Dec 02 20:08:13 2013 -0800
@@ -36,7 +36,6 @@
 import javafx.animation.KeyValue;
 import javafx.animation.Timeline;
 import javafx.application.Application;
-import javafx.application.ConditionalFeature;
 import javafx.scene.Group;
 import javafx.scene.Parent;
 import javafx.scene.PerspectiveCamera;
@@ -64,15 +63,15 @@
     private Timeline animation;
 
     public Parent createContent() {
-        Cube c = new Cube(1, Color.RED, 1);
+        Cube c = new Cube(1, Color.RED);
         c.rx.setAngle(45);
         c.ry.setAngle(45);
-        Cube c2 = new Cube(1, Color.GREEN, 1);
+        Cube c2 = new Cube(1, Color.GREEN);
         c2.setTranslateX(2);
         c2.rx.setAngle(45);
         c2.ry.setAngle(45);
 
-        Cube c3 = new Cube(1, Color.ORANGE, 1);
+        Cube c3 = new Cube(1, Color.ORANGE);
         c3.setTranslateX(-2);
         c3.rx.setAngle(45);
         c3.ry.setAngle(45);
@@ -90,16 +89,15 @@
         animation.setCycleCount(Animation.INDEFINITE);
 
         PerspectiveCamera camera = new PerspectiveCamera(true);
-        camera.getTransforms().add(new Translate(0, 0, -15));
+        camera.getTransforms().add(new Translate(0, 0, -10));
 
         Group root = new Group();
         root.getChildren().addAll(c, c2, c3);
-        SubScene subScene = new SubScene(root, 300, 300);
+        
+        SubScene subScene = new SubScene(root, 640, 480);
         subScene.setCamera(camera);
-        Group group = new Group();
-        group.getChildren().add(subScene);
-
-        return group;
+        
+        return new Group(subScene);
     }
 
     public void play() {
--- a/apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics3d/cubesystem/CubeSystemApp.java	Mon Dec 02 19:11:39 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,240 +0,0 @@
-/*
- * Copyright (c) 2008, 2013 Oracle and/or its affiliates.
- * All rights reserved. Use is subject to license terms.
- *
- * This file is available and licensed under the following license:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- *  - Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  - Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the distribution.
- *  - Neither the name of Oracle Corporation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package ensemble.samples.graphics3d.cubesystem;
-
-import javafx.animation.KeyFrame;
-import javafx.animation.KeyValue;
-import javafx.animation.Timeline;
-import javafx.application.Application;
-import javafx.scene.Parent;
-import javafx.scene.Scene;
-import javafx.scene.paint.Color;
-import javafx.stage.Stage;
-import javafx.util.Duration;
-
-/**
- * A sample that demonstrates an animated rotation of 3D cubes. When the
- * application runs in standalone mode, the scene must be constructed with the
- * depthBuffer argument set to true, and the root node must have depthTest set
- * to true.
- *
- * @sampleName 3D Cube System
- * @preview preview.png
- * @see javafx.scene.transform.Rotate
- * @see javafx.scene.paint.Color
- * @conditionalFeatures SCENE3D
- */
-public class CubeSystemApp extends Application {
-
-    private Timeline animation;
-
-    public Parent createContent() {
-        Xform sceneRoot = new Xform();
-
-        Xform cube1X = new Xform();
-        Cube cube1 = new Cube(40, new Color(1.0, 0.9, 0.0, 1.0), 1.0);
-
-        Xform cube1_1X = new Xform();
-        Xform cube1_2X = new Xform();
-        Xform cube1_3X = new Xform();
-        Xform cube1_4X = new Xform();
-        Xform cube1_5X = new Xform();
-        Xform cube1_6X = new Xform();
-        Xform cube1_7X = new Xform();
-        Xform cube1_8X = new Xform();
-        Xform cube1_9X = new Xform();
-
-        Cube cube1_1 = new Cube(4, Color.RED, 1.0);
-        Cube cube1_2 = new Cube(5, Color.ORANGE, 1.0);
-        Cube cube1_3 = new Cube(6, Color.CORNFLOWERBLUE, 1.0);
-        Cube cube1_4 = new Cube(7, Color.DARKGREEN, 1.0);
-        Cube cube1_5 = new Cube(8, Color.BLUE, 1.0);
-        Cube cube1_6 = new Cube(9, Color.PURPLE, 1.0);
-        Cube cube1_7 = new Cube(10, Color.BLUEVIOLET, 1.0);
-        Cube cube1_8 = new Cube(11, Color.DARKGOLDENROD, 1.0);
-        Cube cube1_9 = new Cube(12, Color.KHAKI, 1.0);
-
-        sceneRoot.getChildren().add(cube1X);
-
-        cube1X.getChildren().add(cube1);
-        cube1X.getChildren().add(cube1_1X);
-        cube1X.getChildren().add(cube1_2X);
-        cube1X.getChildren().add(cube1_3X);
-        cube1X.getChildren().add(cube1_4X);
-        cube1X.getChildren().add(cube1_5X);
-        cube1X.getChildren().add(cube1_6X);
-        cube1X.getChildren().add(cube1_7X);
-        cube1X.getChildren().add(cube1_8X);
-        cube1X.getChildren().add(cube1_9X);
-
-        cube1_1X.getChildren().add(cube1_1);
-        cube1_2X.getChildren().add(cube1_2);
-        cube1_3X.getChildren().add(cube1_3);
-        cube1_4X.getChildren().add(cube1_4);
-        cube1_5X.getChildren().add(cube1_5);
-        cube1_6X.getChildren().add(cube1_6);
-        cube1_7X.getChildren().add(cube1_7);
-        cube1_8X.getChildren().add(cube1_8);
-        cube1_9X.getChildren().add(cube1_9);
-
-        cube1_1.setTranslateX(40.0);
-        cube1_2.setTranslateX(60.0);
-        cube1_3.setTranslateX(80.0);
-        cube1_4.setTranslateX(100.0);
-        cube1_5.setTranslateX(120.0);
-        cube1_6.setTranslateX(140.0);
-        cube1_7.setTranslateX(160.0);
-        cube1_8.setTranslateX(180.0);
-        cube1_9.setTranslateX(200.0);
-
-        cube1_1X.rx.setAngle(30.0);
-        cube1_2X.rz.setAngle(10.0);
-        cube1_3X.rz.setAngle(50.0);
-        cube1_4X.rz.setAngle(170.0);
-        cube1_5X.rz.setAngle(60.0);
-        cube1_6X.rz.setAngle(30.0);
-        cube1_7X.rz.setAngle(120.0);
-        cube1_8X.rz.setAngle(40.0);
-        cube1_9X.rz.setAngle(-60.0);
-
-        double endTime = 4000.0;
-
-        // Animate
-        animation = new Timeline();
-        animation.getKeyFrames().addAll(new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1X.ry.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1X.ry.angleProperty(), 360.0)),
-                new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1X.rx.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1X.rx.angleProperty(), 360.0)),
-                new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1_1X.ry.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1_1X.ry.angleProperty(), -2880.0)),
-                new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1_2X.ry.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1_2X.ry.angleProperty(), -1440.0)),
-                new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1_3X.ry.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1_3X.ry.angleProperty(), -1080.0)),
-                new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1_4X.ry.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1_4X.ry.angleProperty(), -720.0)),
-                new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1_5X.ry.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1_5X.ry.angleProperty(), 1440.0)),
-                new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1_6X.ry.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1_6X.ry.angleProperty(), 1080.0)),
-                new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1_7X.ry.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1_7X.ry.angleProperty(), -360.0)),
-                new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1_8X.ry.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1_8X.ry.angleProperty(), -720.0)),
-                new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1_9X.ry.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1_9X.ry.angleProperty(), -1080.0)),
-                new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1_1.rx.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1_1.rx.angleProperty(), 7200.0)),
-                new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1_2.rx.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1_2.rx.angleProperty(), -7200.0)),
-                new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1_3.rx.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1_3.rx.angleProperty(), 7200.0)),
-                new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1_4.rx.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1_4.rx.angleProperty(), -7200.0)),
-                new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1_5.rx.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1_5.rx.angleProperty(), 7200.0)),
-                new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1_6.rx.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1_6.rx.angleProperty(), -7200.0)),
-                new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1_7.rx.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1_7.rx.angleProperty(), 7200.0)),
-                new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1_8.rx.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1_8.rx.angleProperty(), -7200.0)),
-                new KeyFrame(Duration.ZERO,
-                new KeyValue(cube1_9.rx.angleProperty(), 0.0)),
-                new KeyFrame(new Duration(endTime),
-                new KeyValue(cube1_9.rx.angleProperty(), 7200.0)));
-        animation.setCycleCount(Timeline.INDEFINITE);
-        return sceneRoot;
-    }
-
-    public void play() {
-        animation.play();
-    }
-
-    @Override
-    public void stop() {
-        animation.pause();
-    }
-
-    @Override
-    public void start(Stage primaryStage) throws Exception {
-        primaryStage.setScene(new Scene(createContent()));
-        primaryStage.show();
-        play();
-    }
-
-    /**
-     * Java main for when running without JavaFX launcher
-     * @param args command line arguments
-     */
-    public static void main(String[] args) {
-        launch(args);
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics3d/cubesystem/SphereSystemApp.java	Mon Dec 02 20:08:13 2013 -0800
@@ -0,0 +1,212 @@
+/*
+ * Copyright (c) 2008, 2013 Oracle and/or its affiliates.
+ * All rights reserved. Use is subject to license terms.
+ *
+ * This file is available and licensed under the following license:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the distribution.
+ *  - Neither the name of Oracle Corporation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package ensemble.samples.graphics3d.cubesystem;
+
+import javafx.animation.KeyFrame;
+import javafx.animation.KeyValue;
+import javafx.animation.Timeline;
+import javafx.application.Application;
+import javafx.scene.Group;
+import javafx.scene.Parent;
+import javafx.scene.PerspectiveCamera;
+import javafx.scene.Scene;
+import javafx.scene.SceneAntialiasing;
+import javafx.scene.SubScene;
+import javafx.scene.paint.Color;
+import javafx.scene.transform.Translate;
+import javafx.stage.Stage;
+import javafx.util.Duration;
+
+/**
+ * A sample that demonstrates an animated rotation of 3D spheres.
+ *
+ * @sampleName 3D Sphere System
+ * @preview preview.png
+ * @see javafx.scene.transform.Rotate
+ * @see javafx.scene.paint.Color
+ * @conditionalFeatures SCENE3D
+ */
+public class SphereSystemApp extends Application {
+
+    private Timeline animation;
+
+    public Parent createContent() {
+        Xform sceneRoot = new Xform();
+
+        Xform cube1X = new Xform();
+        Xsphere cube1 = new Xsphere(40, new Color(1.0, 0.9, 0.0, 1.0));
+
+        Xform cube1_1X = new Xform();
+        Xform cube1_2X = new Xform();
+        Xform cube1_3X = new Xform();
+        Xform cube1_4X = new Xform();
+        Xform cube1_5X = new Xform();
+        Xform cube1_6X = new Xform();
+        Xform cube1_7X = new Xform();
+        Xform cube1_8X = new Xform();
+        Xform cube1_9X = new Xform();
+
+        Xsphere cube1_1 = new Xsphere(4, Color.RED);
+        Xsphere cube1_2 = new Xsphere(5, Color.ORANGE);
+        Xsphere cube1_3 = new Xsphere(6, Color.CORNFLOWERBLUE);
+        Xsphere cube1_4 = new Xsphere(7, Color.DARKGREEN);
+        Xsphere cube1_5 = new Xsphere(8, Color.BLUE);
+        Xsphere cube1_6 = new Xsphere(9, Color.PURPLE);
+        Xsphere cube1_7 = new Xsphere(10, Color.BLUEVIOLET);
+        Xsphere cube1_8 = new Xsphere(11, Color.DARKGOLDENROD);
+        Xsphere cube1_9 = new Xsphere(12, Color.KHAKI);
+
+        sceneRoot.getChildren().add(cube1X);
+
+        cube1X.getChildren().add(cube1);
+        cube1X.getChildren().add(cube1_1X);
+        cube1X.getChildren().add(cube1_2X);
+        cube1X.getChildren().add(cube1_3X);
+        cube1X.getChildren().add(cube1_4X);
+        cube1X.getChildren().add(cube1_5X);
+        cube1X.getChildren().add(cube1_6X);
+        cube1X.getChildren().add(cube1_7X);
+        cube1X.getChildren().add(cube1_8X);
+        cube1X.getChildren().add(cube1_9X);
+
+        cube1_1X.getChildren().add(cube1_1);
+        cube1_2X.getChildren().add(cube1_2);
+        cube1_3X.getChildren().add(cube1_3);
+        cube1_4X.getChildren().add(cube1_4);
+        cube1_5X.getChildren().add(cube1_5);
+        cube1_6X.getChildren().add(cube1_6);
+        cube1_7X.getChildren().add(cube1_7);
+        cube1_8X.getChildren().add(cube1_8);
+        cube1_9X.getChildren().add(cube1_9);
+
+        cube1_1.setTranslateX(40.0);
+        cube1_2.setTranslateX(60.0);
+        cube1_3.setTranslateX(80.0);
+        cube1_4.setTranslateX(100.0);
+        cube1_5.setTranslateX(120.0);
+        cube1_6.setTranslateX(140.0);
+        cube1_7.setTranslateX(160.0);
+        cube1_8.setTranslateX(180.0);
+        cube1_9.setTranslateX(200.0);
+
+        cube1_1X.rx.setAngle(30.0);
+        cube1_2X.rz.setAngle(10.0);
+        cube1_3X.rz.setAngle(50.0);
+        cube1_4X.rz.setAngle(170.0);
+        cube1_5X.rz.setAngle(60.0);
+        cube1_6X.rz.setAngle(30.0);
+        cube1_7X.rz.setAngle(120.0);
+        cube1_8X.rz.setAngle(40.0);
+        cube1_9X.rz.setAngle(-60.0);
+
+        double endTime = 4000.0;
+
+        // Animate
+        animation = new Timeline();
+        animation.getKeyFrames().addAll(new KeyFrame(Duration.ZERO,
+                new KeyValue(cube1X.ry.angleProperty(), 0.0),
+                new KeyValue(cube1X.rx.angleProperty(), 0.0),
+                new KeyValue(cube1_1X.ry.angleProperty(), 0.0),
+                new KeyValue(cube1_2X.ry.angleProperty(), 0.0),
+                new KeyValue(cube1_3X.ry.angleProperty(), 0.0),
+                new KeyValue(cube1_4X.ry.angleProperty(), 0.0),
+                new KeyValue(cube1_5X.ry.angleProperty(), 0.0),
+                new KeyValue(cube1_6X.ry.angleProperty(), 0.0),
+                new KeyValue(cube1_7X.ry.angleProperty(), 0.0),
+                new KeyValue(cube1_8X.ry.angleProperty(), 0.0),
+                new KeyValue(cube1_9X.ry.angleProperty(), 0.0),
+                new KeyValue(cube1_1.rx.angleProperty(), 0.0),
+                new KeyValue(cube1_2.rx.angleProperty(), 0.0),
+                new KeyValue(cube1_3.rx.angleProperty(), 0.0),
+                new KeyValue(cube1_4.rx.angleProperty(), 0.0),
+                new KeyValue(cube1_5.rx.angleProperty(), 0.0),
+                new KeyValue(cube1_6.rx.angleProperty(), 0.0),
+                new KeyValue(cube1_7.rx.angleProperty(), 0.0),
+                new KeyValue(cube1_8.rx.angleProperty(), 0.0),
+                new KeyValue(cube1_9.rx.angleProperty(), 0.0)),
+                new KeyFrame(new Duration(endTime),
+                new KeyValue(cube1X.ry.angleProperty(), 360.0),
+                new KeyValue(cube1X.rx.angleProperty(), 360.0),
+                new KeyValue(cube1_1X.ry.angleProperty(), -2880.0),
+                new KeyValue(cube1_2X.ry.angleProperty(), -1440.0),
+                new KeyValue(cube1_3X.ry.angleProperty(), -1080.0),
+                new KeyValue(cube1_4X.ry.angleProperty(), -720.0),
+                new KeyValue(cube1_5X.ry.angleProperty(), 1440.0),
+                new KeyValue(cube1_6X.ry.angleProperty(), 1080.0),
+                new KeyValue(cube1_7X.ry.angleProperty(), -360.0),
+                new KeyValue(cube1_8X.ry.angleProperty(), -720.0),
+                new KeyValue(cube1_9X.ry.angleProperty(), -1080.0),
+                new KeyValue(cube1_1.rx.angleProperty(), 7200.0),
+                new KeyValue(cube1_2.rx.angleProperty(), -7200.0),
+                new KeyValue(cube1_3.rx.angleProperty(), 7200.0),
+                new KeyValue(cube1_4.rx.angleProperty(), -7200.0),
+                new KeyValue(cube1_5.rx.angleProperty(), 7200.0),
+                new KeyValue(cube1_6.rx.angleProperty(), -7200.0),
+                new KeyValue(cube1_7.rx.angleProperty(), 7200.0),
+                new KeyValue(cube1_8.rx.angleProperty(), -7200.0),
+                new KeyValue(cube1_9.rx.angleProperty(), 7200.0)));
+        animation.setCycleCount(Timeline.INDEFINITE);
+        
+        PerspectiveCamera camera = new PerspectiveCamera(true);
+        camera.setFarClip(1500);
+        camera.getTransforms().add(new Translate(0, 0, -900));        
+        
+        SubScene subScene = new SubScene(sceneRoot, 640, 480, true, SceneAntialiasing.BALANCED);
+        subScene.setCamera(camera);
+        
+        return new Group(subScene);
+    }
+
+    public void play() {
+        animation.play();
+    }
+
+    @Override
+    public void stop() {
+        animation.pause();
+    }
+
+    @Override
+    public void start(Stage primaryStage) throws Exception {
+        primaryStage.setScene(new Scene(createContent(), 640, 480, true, SceneAntialiasing.BALANCED));
+        primaryStage.show();
+        play();
+    }
+
+    /**
+     * Java main for when running without JavaFX launcher
+     * @param args command line arguments
+     */
+    public static void main(String[] args) {
+        launch(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics3d/cubesystem/Xsphere.java	Mon Dec 02 20:08:13 2013 -0800
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008, 2013 Oracle and/or its affiliates.
+ * All rights reserved. Use is subject to license terms.
+ *
+ * This file is available and licensed under the following license:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the distribution.
+ *  - Neither the name of Oracle Corporation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package ensemble.samples.graphics3d.cubesystem;
+
+import javafx.scene.paint.Color;
+import javafx.scene.paint.PhongMaterial;
+import javafx.scene.shape.Sphere;
+import javafx.scene.transform.Rotate;
+
+public class Xsphere extends Sphere {
+
+    final Rotate rx = new Rotate(0, Rotate.X_AXIS);
+    final Rotate ry = new Rotate(0, Rotate.Y_AXIS);
+    final Rotate rz = new Rotate(0, Rotate.Z_AXIS);
+
+    public Xsphere(double size, Color color) {
+        super(size);
+        setMaterial(new PhongMaterial(color));
+        getTransforms().addAll(rz, ry, rx);
+    }
+}
--- a/apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics3d/simple3dbox/Simple3DBoxApp.java	Mon Dec 02 19:11:39 2013 -0800
+++ b/apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics3d/simple3dbox/Simple3DBoxApp.java	Mon Dec 02 20:08:13 2013 -0800
@@ -36,11 +36,11 @@
 import javafx.scene.Parent;
 import javafx.scene.PerspectiveCamera;
 import javafx.scene.Scene;
+import javafx.scene.SceneAntialiasing;
 import javafx.scene.SubScene;
 import javafx.scene.paint.Color;
 import javafx.scene.paint.PhongMaterial;
 import javafx.scene.shape.Box;
-import javafx.scene.shape.DrawMode;
 import javafx.scene.transform.Rotate;
 import javafx.scene.transform.Translate;
 import javafx.stage.Stage;
@@ -48,30 +48,42 @@
 /**
  * A sample that shows a 3D box and uses a perspective camera for rendering the 
  * scene.
+ * Hint: Switch to Line draw mode to see how cullFace property works.
  *
  * @sampleName 3D Box
  * @preview preview.png
+ * @see javafx.scene.shape.Box
+ * @see javafx.scene.PerspectiveCamera
+ * @see javafx.scene.paint.PhongMaterial
  * @see javafx.scene.paint.Color
  * @see javafx.scene.transform.Rotate
  * @see javafx.scene.transform.Translate
+ * @see javafx.scene.SceneAntialiasing
+ * @see javafx.scene.SubScene
+ * @playground testBox.drawMode
+ * @playground testBox.cullFace
+ * @playground material.diffuseColor
  * @conditionalFeatures SCENE3D
  */
 public class Simple3DBoxApp extends Application {
+    
+    private Box testBox;
+    private PhongMaterial material;
    
     public Parent createContent() throws Exception {
                
         // Box
-        Box testBox = new Box(5, 5, 5);
-        testBox.setMaterial(new PhongMaterial(Color.RED));
-        testBox.setDrawMode(DrawMode.LINE);
+        testBox = new Box(5, 5, 5);
+        
+        material = new PhongMaterial(Color.RED);
+        testBox.setMaterial(material);
         
         // Create and position camera
         PerspectiveCamera camera = new PerspectiveCamera(true);
         camera.getTransforms().addAll(
-              //  new Translate(5, -5, -15),
                 new Rotate(-20, Rotate.Y_AXIS),
                 new Rotate(-20, Rotate.X_AXIS),
-                 new Translate(0, 0, -15));
+                new Translate(0, 0, -15));
         
         // Build the Scene Graph
         Group root = new Group();       
@@ -79,12 +91,11 @@
         root.getChildren().add(testBox);
         
         // Use a SubScene       
-        SubScene subScene = new SubScene(root, 300,300);
-        subScene.setFill(Color.ALICEBLUE);
+        SubScene subScene = new SubScene(root, 300, 300, true, SceneAntialiasing.BALANCED);
+        subScene.setFill(Color.TRANSPARENT);
         subScene.setCamera(camera);
-        Group group = new Group();
-        group.getChildren().add(subScene);
-        return group;
+        
+        return new Group(subScene);
     }
 
     @Override
--- a/apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics3d/xylophone/XylophoneApp.java	Mon Dec 02 19:11:39 2013 -0800
+++ b/apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics3d/xylophone/XylophoneApp.java	Mon Dec 02 20:08:13 2013 -0800
@@ -216,10 +216,7 @@
         sceneRoot.translateXProperty().bind(subScene.widthProperty().divide(2.2));
         sceneRoot.translateYProperty().bind(subScene.heightProperty().divide(1.6));
 
-        Group group = new Group();
-        group.getChildren().add(subScene);       
-        
-        return group;
+        return new Group(subScene);
     }
 
     public void play() {