当前位置: 首页>>代码示例>>Java>>正文


Java Sphere.setTranslateY方法代码示例

本文整理汇总了Java中javafx.scene.shape.Sphere.setTranslateY方法的典型用法代码示例。如果您正苦于以下问题:Java Sphere.setTranslateY方法的具体用法?Java Sphere.setTranslateY怎么用?Java Sphere.setTranslateY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.shape.Sphere的用法示例。


在下文中一共展示了Sphere.setTranslateY方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildMultipleShapes3D

import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
private Group buildMultipleShapes3D() {
    Box box = new Box(100, 100, 100);
    Sphere sphere = new Sphere(50);
    Cylinder cyl = new Cylinder(50, 100);
    Cone cone = new Cone(50, 100);
    box.setTranslateX(-100);
    box.setTranslateY(-150);

    sphere.setTranslateX(100);
    sphere.setTranslateY(-50);

    cyl.setTranslateX(-100);
    cyl.setTranslateY(50);

    cone.getMesh().setTranslateX(100);
    cone.getMesh().setTranslateY(150);

    nodes.add(box);
    nodes.add(sphere);
    nodes.add(cyl);
    nodes.add(cone.getMesh());
    return new Group(box, sphere, cyl, cone.getMesh());
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:24,代码来源:LightScopeTestApp.java

示例2: initScene

import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
@Override
protected void initScene() {
    DefaultMeshBuilder dmb = new DefaultMeshBuilder() {

        @Override
        protected double function(double fx, double fy) {
            return 1;
        }
    };
    MeshView meshView = new MeshView(dmb.getTriangleMesh());
    meshView.setScaleX(100);
    meshView.setScaleY(100);
    meshView.setScaleZ(100);
    Sphere s = new Sphere(50);
    s.setTranslateX(WIDTH / 2);
    s.setTranslateY(HEIGHT / 2);
    Group root = new Group(s, meshView);
    scene = createScene(root, WIDTH, HEIGHT);
    scene.setCamera(new PerspectiveCamera());
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:21,代码来源:SystemTestApp.java

示例3: setxAxisData

import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
/**
     * @param data the xAxisData to set
     */
    public void setxAxisData(ArrayList<Double> data) {
        xAxisData = data;
        scatterDataGroup.getChildren().clear();
        for(int i=0;i<xAxisData.size();i++) {
            final Sphere dataSphere = new Sphere(scatterRadius);
//            final Box dataSphere = new Box(getScatterRadius(), getScatterRadius(), getScatterRadius());
            double translateY = 0.0;
            double translateZ = 0.0;
            if(!yAxisData.isEmpty() && yAxisData.size() > i)
                translateY = yAxisData.get(i);
            if(!zAxisData.isEmpty() && zAxisData.size() > i)
                translateZ = zAxisData.get(i);
            dataSphere.setTranslateX(xAxisData.get(i));
            dataSphere.setTranslateY(translateY);
            dataSphere.setTranslateZ(translateZ);
            scatterDataGroup.getChildren().add(dataSphere);
        }        
    }
 
开发者ID:sanke69,项目名称:fr.xs.jtk,代码行数:22,代码来源:CubeViewer.java

示例4: setyAxisData

import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
/**
     * @param data the yAxisData to set
     */
    public void setyAxisData(ArrayList<Double> data) {
        yAxisData = data;
        scatterDataGroup.getChildren().clear();
        for(int i=0;i<yAxisData.size();i++) {
            final Sphere dataSphere = new Sphere(scatterRadius);
//            final Box dataSphere = new Box(getScatterRadius(), getScatterRadius(), getScatterRadius());
            double translateX = 0.0;
            double translateZ = 0.0;
            if(!xAxisData.isEmpty() && xAxisData.size() > i)
                translateX = xAxisData.get(i);
            if(!zAxisData.isEmpty() && zAxisData.size() > i)
                translateZ = zAxisData.get(i);
            dataSphere.setTranslateX(translateX);
            dataSphere.setTranslateY(yAxisData.get(i));
            dataSphere.setTranslateZ(translateZ);
            scatterDataGroup.getChildren().add(dataSphere);
        }        
    }
 
开发者ID:sanke69,项目名称:fr.xs.jtk,代码行数:22,代码来源:CubeViewer.java

示例5: setzAxisData

import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
/**
     * @param data the zAxisData to set
     */
    public void setzAxisData(ArrayList<Double> data) {
        zAxisData = data;
        scatterDataGroup.getChildren().clear();
        for(int i=0;i<zAxisData.size();i++) {
            final Sphere dataSphere = new Sphere(scatterRadius);
//            final Box dataSphere = new Box(getScatterRadius(), getScatterRadius(), getScatterRadius());
        
            double translateX = 0.0;
            double translateY = 0.0;
            if(!xAxisData.isEmpty() && xAxisData.size() > i)
                translateX = xAxisData.get(i);
            if(!yAxisData.isEmpty() && yAxisData.size() > i)
                translateY = yAxisData.get(i);
            dataSphere.setTranslateX(translateX);
            dataSphere.setTranslateY(translateY);
            dataSphere.setTranslateZ(zAxisData.get(i));
            scatterDataGroup.getChildren().add(dataSphere);
        }       
    }
 
开发者ID:sanke69,项目名称:fr.xs.jtk,代码行数:23,代码来源:CubeViewer.java

示例6: buildMultipleShapes

import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
private Group buildMultipleShapes() {
    Box box = new Box(100, 100, 100);
    Sphere sphere = new Sphere(50);
    Cylinder cyl = new Cylinder(50, 100);
    Cone cone = new Cone(50, 100);
    Rectangle rect = new Rectangle(50, 50);
    rect.setFill(Color.WHITESMOKE);
    box.setTranslateX(-100);
    box.setTranslateY(-150);

    sphere.setTranslateX(100);
    sphere.setTranslateY(-50);

    cyl.setTranslateX(-100);
    cyl.setTranslateY(50);

    cone.getMesh().setTranslateX(100);
    cone.getMesh().setTranslateY(150);

    rect.setTranslateX(-25);
    rect.setTranslateY(-25);
    rect.setRotationAxis(Rotate.Y_AXIS);
    rect.setRotate(45);

    nodes.add(box);
    nodes.add(sphere);
    nodes.add(cyl);
    nodes.add(cone.getMesh());
    nodes.add(rect);

    return new Group(box, sphere, cyl, cone.getMesh(), rect);
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:33,代码来源:LightScopeTestApp.java

示例7: buildAxes

import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
private void buildAxes() {
    double length = 2d * dimModel;
    double width = dimModel / 100d;
    double radius = 2d * dimModel / 100d;
    final PhongMaterial redMaterial = new PhongMaterial();
    redMaterial.setDiffuseColor(Color.DARKRED);
    redMaterial.setSpecularColor(Color.RED);
    final PhongMaterial greenMaterial = new PhongMaterial();
    greenMaterial.setDiffuseColor(Color.DARKGREEN);
    greenMaterial.setSpecularColor(Color.GREEN);
    final PhongMaterial blueMaterial = new PhongMaterial();
    blueMaterial.setDiffuseColor(Color.DARKBLUE);
    blueMaterial.setSpecularColor(Color.BLUE);
    
    Sphere xSphere = new Sphere(radius);
    Sphere ySphere = new Sphere(radius);
    Sphere zSphere = new Sphere(radius);
    xSphere.setMaterial(redMaterial);
    ySphere.setMaterial(greenMaterial);
    zSphere.setMaterial(blueMaterial);
    
    xSphere.setTranslateX(dimModel);
    ySphere.setTranslateY(dimModel);
    zSphere.setTranslateZ(dimModel);
    
    Box xAxis = new Box(length, width, width);
    Box yAxis = new Box(width, length, width);
    Box zAxis = new Box(width, width, length);
    xAxis.setMaterial(redMaterial);
    yAxis.setMaterial(greenMaterial);
    zAxis.setMaterial(blueMaterial);
    
    autoScalingGroup.getChildren().addAll(xAxis, yAxis, zAxis);
    autoScalingGroup.getChildren().addAll(xSphere, ySphere, zSphere);
}
 
开发者ID:gluonhq,项目名称:gluon-samples,代码行数:36,代码来源:ContentModel.java

示例8: addAtom

import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
private void addAtom(LeafSubstructure<?> origin, Atom atom) {
    Sphere atomShape = new Sphere(1.0);
    atomShape.setMaterial(getMaterial(origin, atom));
    atomShape.setTranslateX(atom.getPosition().getX());
    atomShape.setTranslateY(atom.getPosition().getY());
    atomShape.setTranslateZ(atom.getPosition().getZ());

    // add tooltip
    Tooltip tooltip = new Tooltip(atom.getElement().getName() + " (" + (atom.getAtomName()) + ":" +
            atom.getAtomIdentifier() + ") of " + origin.getFamily().getThreeLetterCode() + ":" + origin.getIdentifier());
    Tooltip.install(atomShape, tooltip);

    moleculeGroup.getChildren().add(atomShape);
}
 
开发者ID:cleberecht,项目名称:singa,代码行数:15,代码来源:StructureViewer.java

示例9: buildScene

import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
private Group buildScene() {
	    Sphere mars = new Sphere(MARS_RADIUS);
	    mars.setTranslateX(VIEWPORT_SIZE / 2d);
	    mars.setTranslateY(VIEWPORT_SIZE / 2d);

	    PhongMaterial material = new PhongMaterial();
	    material.setDiffuseMap(
	      new Image(this.getClass().getResource(DIFFUSE_MAP).toExternalForm(),
	        MAP_WIDTH,
	        MAP_HEIGHT,
	        true,
	        true
	      )
	    );

	    material.setBumpMap(
	      new Image(this.getClass().getResource(NORMAL_MAP).toExternalForm(),
	        MAP_WIDTH,
	        MAP_HEIGHT,
	        true,
	        true
	      )
	    );
/*
	    material.setSpecularMap(
	      new Image(this.getClass().getResource(SPECULAR_MAP).toExternalForm(),
	        MAP_WIDTH,
	        MAP_HEIGHT,
	        true,
	        true
	      )
	    );
*/
	    mars.setMaterial(
	        material
	    );

	    return new Group(mars);
	}
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:40,代码来源:MarsViewer.java

示例10: buildScene

import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
private Group buildScene() {
  Sphere earth = new Sphere(EARTH_RADIUS);
  earth.setTranslateX(VIEWPORT_SIZE / 2d);
  earth.setTranslateY(VIEWPORT_SIZE / 2d);

  PhongMaterial earthMaterial = new PhongMaterial();
  earthMaterial.setDiffuseMap(
    new Image(
      DIFFUSE_MAP,
      MAP_WIDTH,
      MAP_HEIGHT,
      true,
      true
    )
  );
  earthMaterial.setBumpMap(
    new Image(
      NORMAL_MAP,
      MAP_WIDTH,
      MAP_HEIGHT,
      true,
      true
    )
  );
  earthMaterial.setSpecularMap(
    new Image(
      SPECULAR_MAP,
      MAP_WIDTH,
      MAP_HEIGHT,
      true,
      true
    )
  );

  earth.setMaterial(
      earthMaterial
  );

  return new Group(earth);
}
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:41,代码来源:EarthViewer.java

示例11: addSphere

import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
public void addSphere(double x, double y, double z, Material material) {
    Sphere sphere = new Sphere(RADIUS);
    sphere.setTranslateX(x * SCALE_FACTOR);
    sphere.setTranslateY(y * SCALE_FACTOR);
    sphere.setTranslateZ(z * SCALE_FACTOR);
    sphere.setMaterial(material);
    getChildren().add(sphere);
}
 
开发者ID:kcoolsae,项目名称:Equi,代码行数:9,代码来源:Node3D.java

示例12: createSphere

import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
private Sphere createSphere(Physical ball) {
    Sphere sphere = new Sphere(this.radius);
    
    ViewPoint location = ViewPoint.of(ball.getLocation());
    sphere.setTranslateX(location.x);
    sphere.setTranslateY(location.y);
    sphere.setTranslateZ(location.z);
    
    Material material = new PhongMaterial(this.color);
    sphere.setMaterial(material);
    
    return sphere;
}
 
开发者ID:opengl-8080,项目名称:classical-physics,代码行数:14,代码来源:BallLocus.java

示例13: buildAxes

import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
private void buildAxes() {
    double length = 2d*dimModel;
    double width = dimModel/100d;
    double radius = 2d*dimModel/100d;
    final PhongMaterial redMaterial = new PhongMaterial();
    redMaterial.setDiffuseColor(Color.DARKRED);
    redMaterial.setSpecularColor(Color.RED);
    final PhongMaterial greenMaterial = new PhongMaterial();
    greenMaterial.setDiffuseColor(Color.DARKGREEN);
    greenMaterial.setSpecularColor(Color.GREEN);
    final PhongMaterial blueMaterial = new PhongMaterial();
    blueMaterial.setDiffuseColor(Color.DARKBLUE);
    blueMaterial.setSpecularColor(Color.BLUE);
    
    Sphere xSphere = new Sphere(radius);
    Sphere ySphere = new Sphere(radius);
    Sphere zSphere = new Sphere(radius);
    xSphere.setMaterial(redMaterial);
    ySphere.setMaterial(greenMaterial);
    zSphere.setMaterial(blueMaterial);
    
    xSphere.setTranslateX(dimModel);
    ySphere.setTranslateY(dimModel);
    zSphere.setTranslateZ(dimModel);
    
    Box xAxis = new Box(length, width, width);
    Box yAxis = new Box(width, length, width);
    Box zAxis = new Box(width, width, length);
    xAxis.setMaterial(redMaterial);
    yAxis.setMaterial(greenMaterial);
    zAxis.setMaterial(blueMaterial);
    
    autoScalingGroup.getChildren().addAll(xAxis, yAxis, zAxis);
    autoScalingGroup.getChildren().addAll(xSphere, ySphere, zSphere);
}
 
开发者ID:jperedadnr,项目名称:RubikFX,代码行数:36,代码来源:ContentModel.java

示例14: start

import javafx.scene.shape.Sphere; //导入方法依赖的package包/类
@Override 
public void start(Stage primaryStage) throws Exception { 
    final PhongMaterial red = new PhongMaterial(Color.RED); 
    final PhongMaterial green = new PhongMaterial(Color.GREEN); 
    final PhongMaterial blue = new PhongMaterial(Color.BLUE); 
    final Box cube = new Box(200, 200, 200); 
    cube.setLayoutX(150); 
    cube.setLayoutY(800); 
    cube.setDrawMode(DrawMode.LINE); 
    cube.setMaterial(red); 
    final Cylinder cylinder = new Cylinder(150, 50); 
    cylinder.setLayoutX(500); 
    cylinder.setLayoutY(800); 
    cylinder.setDrawMode(DrawMode.LINE); 
    cylinder.setMaterial(green); 
    final Sphere sphere = new Sphere(100); 
    sphere.setLayoutX(850); 
    sphere.setLayoutY(800); 
    sphere.setDrawMode(DrawMode.LINE); 
    sphere.setMaterial(blue); 
    final AmbientLight light = new AmbientLight(Color.WHITE); 
    final Pane root = new Pane(); 
    root.setStyle("-fx-background-color: transparent;"); 
    root.getChildren().addAll(cube, cylinder, sphere, light); 
    final int[] tesselations = {1, 5, 10, 50, 100}; 
    for (int index = 0; index < tesselations.length; index++) { 
        final int dx = 1000 / tesselations.length; 
        final int tesselation = tesselations[index]; 
        final Sphere tesselatedSphere = new Sphere(75, tesselation); 
        tesselatedSphere.setDrawMode(DrawMode.LINE); 
        root.getChildren().add(tesselatedSphere); 
        tesselatedSphere.setTranslateX(100 + dx * index); 
        tesselatedSphere.setTranslateY(400); 
        final Cylinder tesselatedCylinder = new Cylinder(75, 50, tesselation); 
        tesselatedCylinder.setDrawMode(DrawMode.LINE); 
        root.getChildren().add(tesselatedCylinder); 
        tesselatedCylinder.setTranslateX(100 + dx * index); 
        tesselatedCylinder.setTranslateY(100); 
    } 
    final Scene scene = new Scene(root, 1000, 1000); 
    scene.setFill(Color.BLACK); 
    scene.setCamera(new PerspectiveCamera()); 
    primaryStage.setScene(scene); 
    primaryStage.setTitle("Test_Triangle"); 
    primaryStage.show(); 
}
 
开发者ID:sanke69,项目名称:fr.xs.jtk,代码行数:47,代码来源:TesselationTest.java


注:本文中的javafx.scene.shape.Sphere.setTranslateY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。