Java 类javafx.scene.paint.Material 实例源码

项目:openjfx-8u-dev-tests    文件:CameraTestGroupBuilder.java   
private Material getMtrl(int x, int y, int z) {
    if (((x == 0 || x == side - 1) && (y == 0 || y == side - 1))
            || ((x == 0 || x == side - 1) && (z == 0 || z == side - 1))
            || ((z == 0 || z == side - 1) && (y == 0 || y == side - 1))) {
        return borderMtrl;
    }
    if (x == 0) {
        return leftMtrl;
    } else if (x == side - 1) {
        return rightMtrl;
    } else if (y == 0) {
        return topMtrl;
    } else if (y == side - 1) {
        return bottomMtrl;
    } else if (z == 0) {
        return frontMtrl;
    } else if (z == side - 1) {
        return backMtrl;
    }
    return null;
}
项目:eavp    文件:FXColorOption.java   
/**
 * Set all the MeshViews in the group to the given material, as well as the
 * children of any child groups.
 * 
 * @param group
 *            The group whose children will have their material set.
 * @param material
 *            The material to be set to the group's children.
 */
private void setMaterial(Group group, Material material) {

    // Handle each of the group's children
    for (Node node : group.getChildren()) {

        // If the node is a mesh view, set its material
        if (node.getClass() == MeshView.class) {
            ((MeshView) node).setMaterial(material);
        }

        // Otherwise, recursively handle the child group
        else if (node.getClass() == Group.class) {
            setMaterial((Group) node, material);
        }
    }
}
项目:FX3DAndroid    文件:MeshContainer.java   
public List<MeshView> getAsMeshViews() {
    List<MeshView> result = new ArrayList<>(meshes.size());

    for (int i = 0; i < meshes.size(); i++) {

        Mesh mesh = meshes.get(i);
        Material mat = materials.get(i);

        MeshView view = new MeshView(mesh);
        view.setMaterial(mat);
        view.setCullFace(CullFace.NONE);

        result.add(view);
    }

    return result;
}
项目:minecraft-jfx-skin    文件:SkinCanvas.java   
protected void bindMaterial(Group group) {
    Material material = createMaterial();
    for (Node node : group.getChildren())
        if (node instanceof Shape3D)
            ((Shape3D) node).setMaterial(material);
        else if (node instanceof SkinMultipleCubes)
            ((SkinMultipleCubes) node).updateSkin(skin);
        else if (node instanceof Group)
            bindMaterial((Group) node);
}
项目:fr.xs.jtk    文件:TriangleMeshHelper.java   
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;
    }
项目:Equi    文件:Node3D.java   
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);
}
项目:FXyzLib    文件:TriangleMeshHelper.java   
public Material getMaterialWithPattern(){
    PhongMaterial mat = new PhongMaterial();
    mat.setDiffuseMap(getPatternImage());
    mat.setSpecularPower(32);
    mat.setDiffuseColor(Color.WHITE);
    mat.setSpecularColor(Color.WHITE);
    return mat;
}
项目:FXyzLib    文件:TriangleMeshHelper.java   
public Material getMaterialWithPalette(){
    PhongMaterial mat = new PhongMaterial();
    mat.setDiffuseMap(getPaletteImage());
    mat.setSpecularPower(20);
    mat.setDiffuseColor(Color.WHITE);
    mat.setSpecularColor(Color.WHITE);
    return mat;
}
项目:FXyzLib    文件:TriangleMeshHelper.java   
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;
    }
项目:classical-physics    文件:BallLocus.java   
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;
}
项目:FX3DAndroid    文件:MeshContainer.java   
MeshContainer(Vector3d min, Vector3d max, List<Mesh> meshes, List<Material> materials) {
    this.meshes = meshes;
    this.materials = materials;
    this.bounds = new Bounds(min, max);
    this.width = bounds.getBounds().x;
    this.height = bounds.getBounds().y;
    this.depth = bounds.getBounds().z;

    if (materials.size() != meshes.size()) {
        throw new IllegalArgumentException("Mesh list and Material list must not differ in size!");
    }

}
项目:FX3DAndroid    文件:TriangleMeshHelper.java   
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;
    }
项目:minecraft-jfx-skin    文件:SkinMultipleCubes.java   
protected Material createMaterial(Color color) {
    return new PhongMaterial(color);
}
项目:minecraft-jfx-skin    文件:SkinCanvas.java   
protected Material createMaterial() {
    PhongMaterial material = new PhongMaterial();
    material.setDiffuseMap(skin);
    return material;
}
项目:gluon-samples    文件:MtlReader.java   
public Map<String, Material> getMaterials() {
    return Collections.unmodifiableMap(materials);
}
项目:gluon-samples    文件:ObjImporter.java   
public Material getMaterial() {
    return materials.values().iterator().next();
}
项目:gluon-samples    文件:ObjImporter.java   
public Material getMaterial(String key) {
    return materials.get(key);
}
项目:fr.xs.jtk    文件:Cone.java   
public final void setMaterial(Material value) {
    mesh.setMaterial(value);
}
项目:fr.xs.jtk    文件:Capsule.java   
public final void setMaterial(Material value) {
    mesh.setMaterial(value);
}
项目:fr.xs.jtk    文件:TriangleMeshHelper.java   
public void setMaterialWithPattern(Material mat, CarbonPatterns cp){
    Image img = getPatternImage(cp);  
    clearMaterialAndSetDiffMap(material, img);
}
项目:fr.xs.jtk    文件:Tetrahedron.java   
public final void setMaterial(Material value) {
    mesh.setMaterial(value);
}
项目:fr.xs.jtk    文件:Trapezoid.java   
public final void setMaterial(Material value) {
    mesh.setMaterial(value);
}
项目:fr.xs.jtk    文件:Torus.java   
public final void setMaterial(Material value) {
    mesh.setMaterial(value);
}
项目:fr.xs.jtk    文件:Octahedron.java   
public final void setMaterial(Material value) {
    mesh.setMaterial(value);
}
项目:fr.xs.jtk    文件:Pyramid.java   
public final void setMaterial(Material value) {
    mesh.setMaterial(value);
}
项目:fr.xs.jtk    文件:PhongPhactory.java   
public static Material fromColour( Color c) {
       final PhongMaterial mat = new PhongMaterial();
       mat.setDiffuseColor(c); // was darker
       mat.setSpecularColor(c.brighter());
       return mat;      
}
项目:fr.xs.jtk    文件:PhongPhactory.java   
public static Material fromImage( String fileName ) {
    Image img = new Image("file:"+fileName);
    PhongMaterial mat = new PhongMaterial();
    mat.setDiffuseMap(img);
    return mat;     
}
项目:Equi    文件:SimpleGraphView3D.java   
private Material getMaterial(Color color) {
    return materials.computeIfAbsent(color, PhongMaterial::new);
}
项目:FXyzLib    文件:Cone.java   
public final void setMaterial(Material value) {
    mesh.setMaterial(value);
}
项目:FXyzLib    文件:Capsule.java   
public final void setMaterial(Material value) {
    mesh.setMaterial(value);
}
项目:FXyzLib    文件:TriangleMeshHelper.java   
public Material getMaterialWithColor(Color color){
    PhongMaterial mat = new PhongMaterial(color);
    mat.setSpecularPower(32);
    mat.setSpecularColor(Color.WHITE);
    return mat;
}
项目:FXyzLib    文件:TriangleMeshHelper.java   
public Material getMaterialWithImage(String image){
    PhongMaterial mat = new PhongMaterial();
    mat.setDiffuseMap(new Image(image));
    return mat;
}
项目:FXyzLib    文件:Torus.java   
public final void setMaterial(Material value) {
    mesh.setMaterial(value);
}
项目:TweetwallFX    文件:SegmentedTorus.java   
public final void setMaterial(Material value) {
    mesh.setMaterial(value);
}
项目:FX3DAndroid    文件:MeshContainer.java   
/**
 * @return the materials
 */
public List<Material> getMaterials() {
    return materials;
}
项目:FX3DAndroid    文件:PolyObjImporter.java   
public Material getMaterial() {
    return materials.values().iterator().next();
}
项目:FX3DAndroid    文件:PolyObjImporter.java   
public Material getMaterial(String key) {
    return materials.get(key);
}
项目:FX3DAndroid    文件:MtlReader.java   
public Map<String, Material> getMaterials() {
    return Collections.unmodifiableMap(materials);
}
项目:FX3DAndroid    文件:ObjImporter.java   
public Collection<Material> getMaterialCollection() {
    return materials.values();
}
项目:FX3DAndroid    文件:ObjImporter.java   
public Material getMaterial() {
    return materials.values().iterator().next();
}