import org.edisonwj.draw3d.*; import javafx.application.*; import javafx.scene.*; import javafx.scene.paint.*; import javafx.stage.*; public class Draw3DExample1 extends Application { // Need to set the title of the frame. String title = "Draw3D example 1"; void drawingCommands () { // This is a vector: double[] u = {4,3,1}; // Draw a black line, a red sphere and a blue arrow d3.drawLine (5,1,8, 5,3,8); d3.setDrawColor (Color.RED); d3.drawSphere (15, 12, 11, 0.1); d3.setDrawColor (Color.BLUE); d3.drawVector (u); } // No need to read further ////////////////////////////////////////////////////////// Draw3D d3; void preambleCommands () { d3.setAmbientLight(false); d3.setPointLight(true); d3.setCumulate(false); d3.setSequencingOn(); d3.setVectorRadius(1); d3.setArrowRadius(1); } public void start (Stage primaryStage) { d3 = new Draw3D (); Scene scene = d3.buildScene (); preambleCommands (); drawingCommands (); d3.setStart (); primaryStage.setScene (scene); primaryStage.setTitle (title); primaryStage.show (); } public static void main (String[] argv) { launch (argv); } }