本文整理汇总了Java中javafx.scene.paint.PhongMaterial.setSpecularPower方法的典型用法代码示例。如果您正苦于以下问题:Java PhongMaterial.setSpecularPower方法的具体用法?Java PhongMaterial.setSpecularPower怎么用?Java PhongMaterial.setSpecularPower使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.paint.PhongMaterial
的用法示例。
在下文中一共展示了PhongMaterial.setSpecularPower方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildGroup
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
protected Group buildGroup() {
material = new PhongMaterial();
material.setDiffuseColor(Color.ANTIQUEWHITE);
material.setSpecularColor(Color.rgb(255, 255, 255));
material.setSpecularPower(4);
ss = new SemiSphere(2, 120, 120);
Shape3D sh = ss.getMesh();
// Shape3D sh = new Sphere();
sh.setMaterial(material);
sh.setScaleX(SCALE);
sh.setScaleY(SCALE);
sh.setScaleZ(SCALE);
light1Group = new Group();
light2Group = new Group();
light1mv = new GroupMover(light1Group);
light2mv = new GroupMover(light2Group);
root = new Group(light1mv.getGroup(), light2mv.getGroup(), ss.getGroup());
rootmv = new GroupMover(root);
return rootmv.getGroup();
}
示例2: setMaterials
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
/**
* Sets the specified nodes with the materials given in the map
*
* @param nodes
* The nodes to set the materials for
* @param materialMap
* A mapping of the material name to the acctual material
*/
private void setMaterials(List<INode> nodes,
Map<String, Material> materialMap) {
if (nodes != null && !nodes.isEmpty()
&& !materialMap.keySet().isEmpty()) {
// Get the set of render elements from the view
IRenderElementHolder holder = view.getHolder();
for (INode node : nodes) {
// Get the render of the new shape
IRenderElement render = holder.getRender(node);
if (render.getBase() instanceof Shape) {
// Get the material
PhongMaterial newMat = new PhongMaterial();
Material readMat = materialMap
.get(((Shape) render.getBase()).getMaterial()
.getPhongMatName());
if (readMat != null) {
// Convert values to the phong material
newMat.setDiffuseColor(
convertColor(readMat.getDiffuse()));
newMat.setSpecularColor(
convertColor(readMat.getSpecular()));
newMat.setSpecularPower(readMat.getSpecularExponent());
render.setProperty("material", newMat);
}
}
}
}
}
示例3: getMaterialWithColor
import javafx.scene.paint.PhongMaterial; //导入方法依赖的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;
}
示例4: getMaterialWithPattern
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
public Material getMaterialWithPattern(){
PhongMaterial mat = new PhongMaterial();
mat.setDiffuseMap(getPatternImage());
mat.setSpecularPower(32);
mat.setDiffuseColor(Color.WHITE);
mat.setSpecularColor(Color.WHITE);
return mat;
}
示例5: getMaterialWithPalette
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
public Material getMaterialWithPalette(){
PhongMaterial mat = new PhongMaterial();
mat.setDiffuseMap(getPaletteImage());
mat.setSpecularPower(20);
mat.setDiffuseColor(Color.WHITE);
mat.setSpecularColor(Color.WHITE);
return mat;
}
示例6: setMaterial
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
private void setMaterial(PhongMaterial material, Color color) {
// material.setDiffuseColor(web("#cccccc"));
material.setDiffuseColor(color);
material.setSpecularColor(color);
// Color.rgb((int) color.getRed(), (int) color.getGreen(), (int) color.getBlue(), 128 / 256d));
material.setSpecularPower(80);
}