Java Examples for javafx.scene.paint.Material

The following java examples will help you to understand the usage of javafx.scene.paint.Material. These source code samples are taken from different open source projects.

Example 1
Project: classical-physics-master  File: BallLocus.java View source code
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;
}
Example 2
Project: FXyz-master  File: TriangleMeshHelper.java View source code
public Material getMaterialWithColor(Color color, String image) {
    PhongMaterial mat = new PhongMaterial(color);
    if (image != null && !image.isEmpty()) {
        Image img = new Image(image);
        mat.setDiffuseMap(img);
        NormalMap normal = new NormalMap(img);
        //            normal.setIntensity(10);
        //            normal.setIntensityScale(2);
        mat.setBumpMap(normal);
    }
    mat.setSpecularPower(32);
    mat.setSpecularColor(Color.WHITE);
    return mat;
}
Example 3
Project: FXyzLib-master  File: TriangleMeshHelper.java View source code
public Material getMaterialWithColor(Color color, String image) {
    PhongMaterial mat = new PhongMaterial(color);
    if (image != null && !image.isEmpty()) {
        Image img = new Image(image);
        mat.setDiffuseMap(img);
        NormalMap normal = new NormalMap(img);
        //            normal.setIntensity(10);
        //            normal.setIntensityScale(2);
        mat.setBumpMap(normal);
    }
    mat.setSpecularPower(32);
    mat.setSpecularColor(Color.WHITE);
    return mat;
}
Example 4
Project: JXTN-master  File: Shape3DMaker.java View source code
/**
     * 設定屬性{@link Shape3D#setMaterial(javafx.scene.paint.Material)}。
     *
     * @param value 新的屬性值
     * @return 目前的建構器(this)
     */
@SuppressWarnings("unchecked")
public B material(javafx.scene.paint.Material value) {
    this.hasMaterial = true;
    this.valMaterial = value;
    return (B) this;
}