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


Java Material类代码示例

本文整理汇总了Java中javafx.scene.paint.Material的典型用法代码示例。如果您正苦于以下问题:Java Material类的具体用法?Java Material怎么用?Java Material使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getMtrl

import javafx.scene.paint.Material; //导入依赖的package包/类
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;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:22,代码来源:CameraTestGroupBuilder.java

示例2: setMaterial

import javafx.scene.paint.Material; //导入依赖的package包/类
/**
 * 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);
		}
	}
}
 
开发者ID:eclipse,项目名称:eavp,代码行数:26,代码来源:FXColorOption.java

示例3: getAsMeshViews

import javafx.scene.paint.Material; //导入依赖的package包/类
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;
}
 
开发者ID:lyrachord,项目名称:FX3DAndroid,代码行数:18,代码来源:MeshContainer.java

示例4: bindMaterial

import javafx.scene.paint.Material; //导入依赖的package包/类
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);
}
 
开发者ID:InfinityStudio,项目名称:minecraft-jfx-skin,代码行数:11,代码来源:SkinCanvas.java

示例5: getMaterialWithColor

import javafx.scene.paint.Material; //导入依赖的package包/类
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;
    }
 
开发者ID:sanke69,项目名称:fr.xs.jtk,代码行数:15,代码来源:TriangleMeshHelper.java

示例6: addSphere

import javafx.scene.paint.Material; //导入依赖的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

示例7: getMaterialWithPattern

import javafx.scene.paint.Material; //导入依赖的package包/类
public Material getMaterialWithPattern(){
    PhongMaterial mat = new PhongMaterial();
    mat.setDiffuseMap(getPatternImage());
    mat.setSpecularPower(32);
    mat.setDiffuseColor(Color.WHITE);
    mat.setSpecularColor(Color.WHITE);
    return mat;
}
 
开发者ID:FXyz,项目名称:FXyzLib,代码行数:9,代码来源:TriangleMeshHelper.java

示例8: getMaterialWithPalette

import javafx.scene.paint.Material; //导入依赖的package包/类
public Material getMaterialWithPalette(){
    PhongMaterial mat = new PhongMaterial();
    mat.setDiffuseMap(getPaletteImage());
    mat.setSpecularPower(20);
    mat.setDiffuseColor(Color.WHITE);
    mat.setSpecularColor(Color.WHITE);
    return mat;
}
 
开发者ID:FXyz,项目名称:FXyzLib,代码行数:9,代码来源:TriangleMeshHelper.java

示例9: createSphere

import javafx.scene.paint.Material; //导入依赖的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

示例10: MeshContainer

import javafx.scene.paint.Material; //导入依赖的package包/类
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!");
    }

}
 
开发者ID:lyrachord,项目名称:FX3DAndroid,代码行数:14,代码来源:MeshContainer.java

示例11: createMaterial

import javafx.scene.paint.Material; //导入依赖的package包/类
protected Material createMaterial(Color color) {
	return new PhongMaterial(color);
}
 
开发者ID:InfinityStudio,项目名称:minecraft-jfx-skin,代码行数:4,代码来源:SkinMultipleCubes.java

示例12: createMaterial

import javafx.scene.paint.Material; //导入依赖的package包/类
protected Material createMaterial() {
	PhongMaterial material = new PhongMaterial();
	material.setDiffuseMap(skin);
	return material;
}
 
开发者ID:InfinityStudio,项目名称:minecraft-jfx-skin,代码行数:6,代码来源:SkinCanvas.java

示例13: getMaterials

import javafx.scene.paint.Material; //导入依赖的package包/类
public Map<String, Material> getMaterials() {
    return Collections.unmodifiableMap(materials);
}
 
开发者ID:gluonhq,项目名称:gluon-samples,代码行数:4,代码来源:MtlReader.java

示例14: getMaterial

import javafx.scene.paint.Material; //导入依赖的package包/类
public Material getMaterial() {
    return materials.values().iterator().next();
}
 
开发者ID:gluonhq,项目名称:gluon-samples,代码行数:4,代码来源:ObjImporter.java

示例15: setMaterial

import javafx.scene.paint.Material; //导入依赖的package包/类
public final void setMaterial(Material value) {
    mesh.setMaterial(value);
}
 
开发者ID:sanke69,项目名称:fr.xs.jtk,代码行数:4,代码来源:Cone.java


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