Java 类javafx.scene.DepthTest 实例源码

项目:fr.xs.jtk    文件:KnotMesh.java   
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);
}
项目:fr.xs.jtk    文件:IcosahedronMesh.java   
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();
        }
    });
}
项目:fr.xs.jtk    文件:CurvedSpringMesh.java   
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);
}
项目:fr.xs.jtk    文件:SpringMesh.java   
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);

}
项目:FXyzLib    文件:KnotMesh.java   
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);
}
项目:FXyzLib    文件:IcosahedronMesh.java   
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();
        }
    });
}
项目:FXyzLib    文件:CurvedSpringMesh.java   
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);
}
项目:FXyzLib    文件:SpringMesh.java   
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);

}
项目:COrnLathe    文件:MultiLine3D.java   
/**
   * Construct a new MultiLine3D object.
   *
   * @param lines list of lines
   */
  public MultiLine3D(List<Line3D> lines) {
    lineMaterial.setDiffuseColor(color);
    lineMaterial.setSpecularColor(color);

    //The MeshView allows you to control how the TriangleMesh is rendered
    meshView.setDrawMode(DrawMode.FILL);    //Fill so that the line shows width
//    meshView.setDrawMode(DrawMode.LINE);    // only show lines
    meshView.setCullFace(CullFace.NONE);    // no culling (backs are black)
    meshView.setMaterial(lineMaterial);
    this.getChildren().add(meshView);

    // add dummy Texture Coordinate
    mesh.getTexCoords().addAll(0, 0);

    setDepthTest(DepthTest.INHERIT);

    if (!lines.isEmpty()) {
      refresh(lines);
    }
  }
项目:FX3DAndroid    文件:KnotMesh.java   
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);
}
项目:FX3DAndroid    文件:IcosahedronMesh.java   
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();
        }
    });
}
项目:FX3DAndroid    文件:CurvedSpringMesh.java   
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);
}
项目:FX3DAndroid    文件:SpringMesh.java   
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);

}
项目:incubator-netbeans    文件:Cube3D.java   
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());
}
项目:incubator-netbeans    文件:CubeSystem3D.java   
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());
}
项目:incubator-netbeans    文件:AudioVisualizer3D.java   
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());
}
项目:marathonv5    文件:Sample3D.java   
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);
}
项目:marathonv5    文件:AlphaMediaPlayer.java   
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;
}
项目:marathonv5    文件:Sample3D.java   
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);
}
项目:marathonv5    文件:AlphaMediaPlayer.java   
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;
}
项目:openjfx-8u-dev-tests    文件:Transforms3DApp.java   
@Override
protected Scene getScene()
{
    Scene zScene = super.getScene();
    zScene.getRoot().setDepthTest(DepthTest.ENABLE);
    zScene.setCamera(new PerspectiveCamera());
    //System.out.println("Camera angle " + new PerspectiveCamera().getFieldOfView());
    return zScene;
}
项目:openjfx-8u-dev-tests    文件:DepthTestTest.java   
private void iterate(TestCore core)
{
    boolean doneWell = true;

    for(final DepthTestScene.Nodes node1: DepthTestScene.Nodes.values())
    {
        for(final DepthTestScene.Nodes node2: DepthTestScene.Nodes.values())
        {
            for(final DepthTest dt1: DepthTest.values())
            {
                for(final DepthTest dt2: DepthTest.values())
                {
                    for(final DepthTest dt3: new DepthTest[]{DepthTest.DISABLE, DepthTest.ENABLE})
                    {
                        for(final ToggleButtonWrap<? extends RadioButton> tbw:
                                new ToggleButtonWrap[]{firstToFront, secondToFront})
                        {
                            new GetAction<Object>() {

                                @Override
                                public void run(Object... os) throws Exception {
                                    firstNodeCombo.getControl().getSelectionModel().select(node1);
                                    secondNodeCombo.getControl().getSelectionModel().select(node2);
                                    firstDTest.getControl().getSelectionModel().select(dt1);
                                    secondDTest.getControl().getSelectionModel().select(dt2);
                                    parentDTest.getControl().getSelectionModel().select(dt3);
                                    tbw.getControl().fire();
                                }
                            }.dispatch(Root.ROOT.getEnvironment());
                            firstNode = byID(getScene(), firstNodeCombo.getControl().getValue().toString() + "-green", Node.class);
                            secondNode = byID(getScene(), secondNodeCombo.getControl().getValue().toString() + "-red", Node.class);
                            doneWell &= core.execute();
                        }
                    }
                }
            }
        }
    }
    Assert.assertTrue(doneWell);
}
项目:cirmlive    文件:CiRMLive3d.java   
public Parent createContent() {
    BorderPane p = new BorderPane();
    HBox btBox = new HBox(50, leftBt, lookLeftBt, forwardBt, upBt, downBt, backBt, lookRightBt, rightBt); 
    btBox.alignmentProperty().set(Pos.CENTER);
    p.setBottom(btBox);
    setUpButtons();
    PerspectiveCamera camera = new PerspectiveCamera(true);
    camera.getTransforms().add(cameraTranslate);
    camera.getTransforms().add(cameraRotate);
    camera.setFieldOfView(50);
    camera.setFarClip(10000);
    camera.setNearClip(1);
    p.setDepthTest(DepthTest.ENABLE);
    BorderPane cirmLiveUI = cirmLive.createSceneContent();
    cirmLiveUI.setCache(true);
    cirmLiveUI.setCacheShape(true);
    cirmLiveUI.setCacheHint(CacheHint.QUALITY);
    //cirmLiveUI.setSsetAlignment(camera, Pos.CENTER);
    //cirmLiveUI.setTranslateZ(500);
    //TODO root.getChildren().addAll(c, c2, c3);

    SubScene subScene = new SubScene(cirmLiveUI, 1600, 900, true, SceneAntialiasing.BALANCED);
    subScene.setFill(Color.CORAL);
    subScene.setCamera(camera);
    p.setCenter(subScene);       
    return p;
}
项目:fr.xs.jtk    文件:Histogram.java   
private void init() {
    getChildren().add(histogramDataGroup);
    if (selfLightEnabled) {
        getChildren().add(selfLight);
    }
    setDepthTest(DepthTest.ENABLE);
}
项目:fr.xs.jtk    文件:ScatterPlot.java   
private void init(){
    getChildren().add(scatterDataGroup); //Holds ScatterPlot data        
    if(selfLightEnabled) {
        getChildren().add(selfLight);
    }
    setDepthTest(DepthTest.ENABLE);        
}
项目:fr.xs.jtk    文件:CuboidMesh.java   
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);
}
项目:fr.xs.jtk    文件:SurfacePlotMesh.java   
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);
}
项目:fr.xs.jtk    文件:PrismMesh.java   
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);
}
项目:fr.xs.jtk    文件:SegmentedTorusMesh.java   
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);
}
项目:fr.xs.jtk    文件:BezierMesh.java   
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);
}
项目:fr.xs.jtk    文件:TorusMesh.java   
public TorusMesh(int rDivs, int tDivs, double radius, double tRadius) {
    setRadiusDivisions(rDivs);
    setTubeDivisions(tDivs);
    setRadius(radius);
    setTubeRadius(tRadius);

    setDepthTest(DepthTest.ENABLE);
    updateMesh();
}
项目:fr.xs.jtk    文件:SegmentedSphereMesh.java   
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);
}
项目:fr.xs.jtk    文件:FrustumMesh.java   
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);
}
项目:fr.xs.jtk    文件:TetrahedraMesh.java   
public TetrahedraMesh(double height, int level, Point3D center){
    setHeight(height);        
    setLevel(level);
    setCenter(center);

    updateMesh();
    setCullFace(CullFace.BACK);
    setDrawMode(DrawMode.FILL);
    setDepthTest(DepthTest.ENABLE);
}
项目:fr.xs.jtk    文件:CubeViewer.java   
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);
}
项目:FXyzLib    文件:Histogram.java   
private void init() {
    getChildren().add(histogramDataGroup);
    if (selfLightEnabled) {
        getChildren().add(selfLight);
    }
    setDepthTest(DepthTest.ENABLE);
}
项目:FXyzLib    文件:ScatterPlot.java   
private void init(){
    getChildren().add(scatterDataGroup); //Holds ScatterPlot data        
    if(selfLightEnabled) {
        getChildren().add(selfLight);
    }
    setDepthTest(DepthTest.ENABLE);        
}
项目:FXyzLib    文件:CuboidMesh.java   
public CuboidMesh(double width, double height, double depth, int level){
    setWidth(width);        
    setHeight(height);        
    setDepth(depth);        
    setLevel(level);

    updateMesh();
    setCullFace(CullFace.BACK);
    setDrawMode(DrawMode.FILL);
    setDepthTest(DepthTest.ENABLE);
}
项目:FXyzLib    文件:SurfacePlotMesh.java   
public SurfacePlotMesh(Function<Point2D,Number> function, double rangeX, double rangeY, int divisionsX, int divisionsY, double scale) {
    setFunction2D(function);
    setRangeX(rangeX);
    setRangeY(rangeY);
    setDivisionsX(divisionsX);
    setDivisionsY(divisionsY);
    setScale(scale);

    updateMesh();
    setCullFace(CullFace.BACK);
    setDrawMode(DrawMode.FILL);
    setDepthTest(DepthTest.ENABLE);
}
项目:FXyzLib    文件:PrismMesh.java   
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);
}