javafx.scene.DepthTest Java Examples

The following examples show how to use javafx.scene.DepthTest. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: KnotMesh.java    From FXyzLib with GNU General Public License v3.0 6 votes vote down vote up
public KnotMesh(double majorRadius, double minorRadius, double wireRadius, double p, double q, 
                  int rDivs, int tDivs, int lengthCrop, int wireCrop) {
    
    setMajorRadius(majorRadius);
    setMinorRadius(minorRadius);
    setWireRadius(wireRadius);
    setP(p);
    setQ(q);
    setLengthDivisions(rDivs);
    setWireDivisions(tDivs);
    setLengthCrop(lengthCrop);
    setWireCrop(wireCrop);
    
    updateMesh();
    setCullFace(CullFace.BACK);
    setDrawMode(DrawMode.FILL);
    setDepthTest(DepthTest.ENABLE);
}
 
Example #2
Source File: IcosahedronMesh.java    From FXyzLib with GNU General Public License v3.0 6 votes vote down vote up
public IcosahedronMesh(int level, float diameter){
    setLevel(level);
    setDiameter(diameter);

    updateMesh();
    setCullFace(CullFace.BACK);
    setDrawMode(DrawMode.FILL);
    setDepthTest(DepthTest.ENABLE);
    
    diameterProperty().addListener((obs,f0,f1)->{
        if(mesh!=null && f0!=null && f1!=null && f0.floatValue()>0 && f1.floatValue()>0){
            updateVertices(f1.floatValue()/f0.floatValue());
        }
    });
    
    levelProperty().addListener((obs,i0,i1)->{
        if(mesh!=null && i1!=null && i1.intValue()>=0){
            updateMesh();
        }
    });
}
 
Example #3
Source File: CurvedSpringMesh.java    From FXyzLib with GNU General Public License v3.0 6 votes vote down vote up
public CurvedSpringMesh(double majorRadius, double minorRadius, double wireRadius, double pitch, double length, 
                  int rDivs, int tDivs, int lengthCrop, int wireCrop) {
    
    setMajorRadius(majorRadius);
    setMinorRadius(minorRadius);
    setWireRadius(wireRadius);
    setPitch(pitch);
    setLength(length);
    setLengthDivisions(rDivs);
    setWireDivisions(tDivs);
    setLengthCrop(lengthCrop);
    setWireCrop(wireCrop);
    
    updateMesh();
    setCullFace(CullFace.BACK);
    setDrawMode(DrawMode.FILL);
    setDepthTest(DepthTest.ENABLE);
}
 
Example #4
Source File: SpringMesh.java    From FXyzLib with GNU General Public License v3.0 6 votes vote down vote up
public SpringMesh(double meanRadius, double wireRadius, double pitch, double length, 
                  int rDivs, int tDivs, int lengthCrop, int wireCrop) {
    
    setMeanRadius(meanRadius);
    setWireRadius(wireRadius);
    setPitch(pitch);
    setLength(length);
    factor=length/pitch;
    setLengthDivisions(rDivs);
    setWireDivisions(tDivs);
    setLengthCrop(lengthCrop);
    setWireCrop(wireCrop);
    
    updateMesh();
    setCullFace(CullFace.BACK);
    setDrawMode(DrawMode.FILL);
    setDepthTest(DepthTest.ENABLE);
    
}
 
Example #5
Source File: CSGMesh.java    From FXyzLib with GNU General Public License v3.0 5 votes vote down vote up
public CSGMesh(CSG primitive){
    this.primitive=primitive;
    
    updateMesh();
    setCullFace(CullFace.BACK);
    setDrawMode(DrawMode.FILL);
    setDepthTest(DepthTest.ENABLE);
}
 
Example #6
Source File: SurfacePlotMesh.java    From FXyzLib with GNU General Public License v3.0 5 votes vote down vote up
public SurfacePlotMesh(Function<Point2D,Number> function, double rangeX, double rangeY, int divisionsX, int divisionsY, double functionScale) {
    setFunction2D(function);
    setRangeX(rangeX);
    setRangeY(rangeY);
    setDivisionsX(divisionsX);
    setDivisionsY(divisionsY);
    setFunctionScale(functionScale);
    
    updateMesh();
    setCullFace(CullFace.BACK);
    setDrawMode(DrawMode.FILL);
    setDepthTest(DepthTest.ENABLE);
}
 
Example #7
Source File: TriangulatedMesh.java    From FXyzLib with GNU General Public License v3.0 5 votes vote down vote up
public TriangulatedMesh(List<Point3D> points, List<List<Point3D>> pointsHole, int level, double height, double holeRadius, Bounds bounds) {
    this.pointsExterior=points;
    this.pointsHoles=pointsHole;
    setLevel(level);
    setHeight(height);
    setHoleRadius(holeRadius);
    setBounds(bounds);
    
    updateMesh();
    setCullFace(CullFace.BACK);
    setDrawMode(DrawMode.FILL);
    setDepthTest(DepthTest.ENABLE);
}
 
Example #8
Source File: PrismMesh.java    From FXyzLib with GNU General Public License v3.0 5 votes vote down vote up
public PrismMesh(double radius, double height, int level, Point3D pIni, Point3D pEnd){
    setAxisOrigin(pIni==null?new Point3D(0,(float)height/2f,0):pIni);
    setAxisEnd(pEnd==null?new Point3D(0,-(float)height/2f,0):pEnd);
    setRadius(radius);
    setHeight(getAxisEnd().substract(getAxisOrigin()).magnitude());
    setLevel(level);
    
    updateMesh();
    setCullFace(CullFace.BACK);
    setDrawMode(DrawMode.FILL);
    setDepthTest(DepthTest.ENABLE);
}
 
Example #9
Source File: SegmentedTorusMesh.java    From FXyzLib with GNU General Public License v3.0 5 votes vote down vote up
public SegmentedTorusMesh(int rDivs, int tDivs, int crop, double majorRadius, double minorRadius) {
    setMajorRadiusDivisions(rDivs);
    setMinorRadiusDivisions(tDivs);
    setMajorRadiusCrop(crop);
    setMajorRadius(majorRadius);
    setMinorRadius(minorRadius);
    
    updateMesh();
    setCullFace(CullFace.BACK);
    setDrawMode(DrawMode.FILL);
    setDepthTest(DepthTest.ENABLE);
}
 
Example #10
Source File: CuboidMesh.java    From FXyzLib with GNU General Public License v3.0 5 votes vote down vote up
public CuboidMesh(double width, double height, double depth, int level, Point3D center){
    setWidth(width);        
    setHeight(height);        
    setDepth(depth);        
    setLevel(level);
    setCenter(center);
    
    updateMesh();
    setCullFace(CullFace.BACK);
    setDrawMode(DrawMode.FILL);
    setDepthTest(DepthTest.ENABLE);
}
 
Example #11
Source File: BezierMesh.java    From FXyzLib with GNU General Public License v3.0 5 votes vote down vote up
public BezierMesh(BezierHelper spline, double wireRadius, 
                  int rDivs, int tDivs, int lengthCrop, int wireCrop) {
    
    setSpline(spline);
    setWireRadius(wireRadius);
    setLengthDivisions(rDivs);
    setWireDivisions(tDivs);
    setLengthCrop(lengthCrop);
    setWireCrop(wireCrop);
    
    updateMesh();
    setCullFace(CullFace.BACK);
    setDrawMode(DrawMode.FILL);
    setDepthTest(DepthTest.ENABLE);
}
 
Example #12
Source File: TorusMesh.java    From FXyzLib with GNU General Public License v3.0 5 votes vote down vote up
public TorusMesh(int rDivs, int tDivs, double radius, double tRadius) {
    setRadiusDivisions(rDivs);
    setTubeDivisions(tDivs);
    setRadius(radius);
    setTubeRadius(tRadius);
    
    setDepthTest(DepthTest.ENABLE);
    updateMesh();
}
 
Example #13
Source File: SegmentedSphereMesh.java    From FXyzLib with GNU General Public License v3.0 5 votes vote down vote up
public SegmentedSphereMesh(int tDivs, int cropX, int cropY, double radius, Point3D center) {
    setRadiusDivisions(tDivs);
    setRadiusCropX(cropX);
    setRadiusCropY(cropY);
    setRadius(radius);
    setzOffset(1);
    setCenter(center);
    
    updateMesh();
    setCullFace(CullFace.BACK);
    setDrawMode(DrawMode.FILL);
    setDepthTest(DepthTest.ENABLE);
}
 
Example #14
Source File: FrustumMesh.java    From FXyzLib with GNU General Public License v3.0 5 votes vote down vote up
public FrustumMesh(double majorRadius, double minorRadius, double height, int level, Point3D pIni, Point3D pEnd){
    setAxisOrigin(pIni==null?new Point3D(0,(float)height/2f,0):pIni);
    setAxisEnd(pEnd==null?new Point3D(0,-(float)height/2f,0):pEnd);
    setMajorRadius(majorRadius);
    setMinorRadius(minorRadius);
    setLevel(level);
    
    updateMesh();
    setCullFace(CullFace.BACK);
    setDrawMode(DrawMode.FILL);
    setDepthTest(DepthTest.ENABLE);
}
 
Example #15
Source File: TetrahedraMesh.java    From FXyzLib with GNU General Public License v3.0 5 votes vote down vote up
public TetrahedraMesh(double height, int level, Point3D center){
    setHeight(height);        
    setLevel(level);
    setCenter(center);
    
    updateMesh();
    setCullFace(CullFace.BACK);
    setDrawMode(DrawMode.FILL);
    setDepthTest(DepthTest.ENABLE);
}
 
Example #16
Source File: BillBoardBehaviorTest.java    From FXyzLib with GNU General Public License v3.0 5 votes vote down vote up
public BillBoard() {
    super();
    Image image = new Image("http://overshoot.tv/sites/overshoot.tv/files/Oak_Tree_0.png");
    setFitWidth(800);
    setPreserveRatio(true);
    setSmooth(true);
    setImage(image);  
    setDepthTest(DepthTest.ENABLE);
}
 
Example #17
Source File: CubeViewer.java    From FXyzLib with GNU General Public License v3.0 5 votes vote down vote up
private void init(){
    buildAxes(axesSize, axesThickness);
    buildPanels(axesSize);
    buildGrids(axesSize, gridLineSpacing);
    buildEventHandlers();        
    getChildren().add(scatterDataGroup); //Holds ScatterPlot data
    if(selfLightEnabled) {
        PointLight light = new PointLight(Color.WHITE);
        getChildren().add(light);
    }
    setDepthTest(DepthTest.ENABLE);
}
 
Example #18
Source File: SegmentedTorus.java    From TweetwallFX with MIT License 5 votes vote down vote up
public SegmentedTorus(int rDivs, int tDivs, int crop, double radius, double tRadius) {
    this();
    mesh.setRadiusDivisions(rDivs);
    mesh.setTubeDivisions(tDivs);
    mesh.setTorusCrop(crop);
    mesh.setRadius(radius);
    mesh.setTubeRadius(tRadius);
    mesh.setDepthTest(DepthTest.ENABLE);
}
 
Example #19
Source File: Sample3D.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
protected Sample3D(double width, double height) {
    super(width, height);
    Group group3d = new Group(create3dContent());
    group3d.setDepthTest(DepthTest.ENABLE);
    group3d.getTransforms().addAll(
            new Translate(width / 2, height / 2),
            new Rotate(180, Rotate.X_AXIS)
    );
    getChildren().add(group3d);
}
 
Example #20
Source File: AlphaMediaPlayer.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
private static Group createViewer(final MediaPlayer player, final double scale, boolean blur) {
    Group mediaGroup = new Group();

    final MediaView mediaView = new MediaView(player);

    if (blur) {
        BoxBlur bb = new BoxBlur();
        bb.setWidth(4);
        bb.setHeight(4);
        bb.setIterations(1);
        mediaView.setEffect(bb);
    }

    double width = player.getMedia().getWidth();
    double height = player.getMedia().getHeight();

    mediaView.setFitWidth(width);
    mediaView.setTranslateX(-width/2.0); 
    mediaView.setScaleX(-scale);

    mediaView.setFitHeight(height);
    mediaView.setTranslateY(-height/2.0);
    mediaView.setScaleY(scale);

    mediaView.setDepthTest(DepthTest.ENABLE);
    mediaGroup.getChildren().add(mediaView);
    return mediaGroup;
}
 
Example #21
Source File: Sample3D.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
protected Sample3D(double width, double height) {
    super(width, height);
    Group group3d = new Group(create3dContent());
    group3d.setDepthTest(DepthTest.ENABLE);
    group3d.getTransforms().addAll(
            new Translate(width / 2, height / 2),
            new Rotate(180, Rotate.X_AXIS)
    );
    getChildren().add(group3d);
}
 
Example #22
Source File: AlphaMediaPlayer.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
private static Group createViewer(final MediaPlayer player, final double scale, boolean blur) {
    Group mediaGroup = new Group();

    final MediaView mediaView = new MediaView(player);

    if (blur) {
        BoxBlur bb = new BoxBlur();
        bb.setWidth(4);
        bb.setHeight(4);
        bb.setIterations(1);
        mediaView.setEffect(bb);
    }

    double width = player.getMedia().getWidth();
    double height = player.getMedia().getHeight();

    mediaView.setFitWidth(width);
    mediaView.setTranslateX(-width/2.0); 
    mediaView.setScaleX(-scale);

    mediaView.setFitHeight(height);
    mediaView.setTranslateY(-height/2.0);
    mediaView.setScaleY(scale);

    mediaView.setDepthTest(DepthTest.ENABLE);
    mediaGroup.getChildren().add(mediaView);
    return mediaGroup;
}
 
Example #23
Source File: Cube3D.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void init(Stage primaryStage) {
    Group root = new Group();
    root.setDepthTest(DepthTest.ENABLE);
    primaryStage.setResizable(false);
    primaryStage.setScene(new Scene(root, 400, 150, true));
    primaryStage.getScene().setCamera(new PerspectiveCamera());
    root.getTransforms().addAll(
        new Translate(400 / 2, 150 / 2),
        new Rotate(180, Rotate.X_AXIS)
    );
    root.getChildren().add(create3dContent());
}
 
Example #24
Source File: CubeSystem3D.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void init(Stage primaryStage) {
    Group root = new Group();
    root.setDepthTest(DepthTest.ENABLE);
    primaryStage.setResizable(false);
    primaryStage.setScene(new Scene(root, 500, 500, true));
    primaryStage.getScene().setCamera(new PerspectiveCamera());
    root.getTransforms().addAll(
        new Translate(500 / 2, 500 / 2),
        new Rotate(180, Rotate.X_AXIS)
    );
    root.getChildren().add(create3dContent());
}
 
Example #25
Source File: AudioVisualizer3D.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void init(Stage primaryStage) {
    Group root = new Group();
    root.setDepthTest(DepthTest.ENABLE);
    primaryStage.setResizable(false);
    primaryStage.setScene(new Scene(root, 400, 500, true));
    primaryStage.getScene().setCamera(new PerspectiveCamera());
    root.getTransforms().addAll(
        new Translate(400 / 2, 500 / 2 + 100),
        new Rotate(180, Rotate.X_AXIS)
    );
    root.getChildren().add(create3dContent());
}
 
Example #26
Source File: Viewer3d.java    From phoebus with Eclipse Public License 1.0 5 votes vote down vote up
/** @param disabled Disable mouse interaction?
 *  @throws Exception on error
 */
public Viewer3d (final boolean disabled) throws Exception
{
    axes = buildAxes();
    view.getChildren().add(axes);

    root = new Group(view);
    root.setDepthTest(DepthTest.ENABLE);

    scene = new SubScene(root, 1024, 768, true, SceneAntialiasing.BALANCED);
    scene.setManaged(false);
    scene.setFill(Color.GRAY);
    scene.heightProperty().bind(heightProperty());
    scene.widthProperty().bind(widthProperty());

    buildCamera();

    scene.setCamera(camera);

    // Legend, placed on top of 3D scene
    final HBox legend = new HBox(10, createAxisLabel("X Axis", Color.RED),
            createAxisLabel("Y Axis", Color.GREEN),
            createAxisLabel("Z Axis", Color.BLUE));
    legend.setPadding(new Insets(10));

    getChildren().setAll(scene, legend);

    if (! disabled)
        handleMouse(this);
}
 
Example #27
Source File: SegmentedTorusMesh.java    From TweetwallFX with MIT License 5 votes vote down vote up
public SegmentedTorusMesh(int rDivs, int tDivs, int crop, double radius, double tRadius) {
    setRadiusDivisions(rDivs);
    setTubeDivisions(tDivs);
    setTorusCrop(crop);
    setRadius(radius);
    setTubeRadius(tRadius);

    setDepthTest(DepthTest.ENABLE);
    updateMesh();
}
 
Example #28
Source File: Histogram.java    From FXyzLib with GNU General Public License v3.0 5 votes vote down vote up
private void init() {
    getChildren().add(histogramDataGroup);
    if (selfLightEnabled) {
        getChildren().add(selfLight);
    }
    setDepthTest(DepthTest.ENABLE);
}
 
Example #29
Source File: ScatterPlot.java    From FXyzLib with GNU General Public License v3.0 5 votes vote down vote up
private void init(){
    getChildren().add(scatterDataGroup); //Holds ScatterPlot data        
    if(selfLightEnabled) {
        getChildren().add(selfLight);
    }
    setDepthTest(DepthTest.ENABLE);        
}
 
Example #30
Source File: ScatterPlotMesh.java    From FXyzLib with GNU General Public License v3.0 4 votes vote down vote up
private void init(){
    if(selfLightEnabled) {
        getChildren().add(selfLight);
    }
    setDepthTest(DepthTest.ENABLE);        
}