本文整理汇总了Java中javafx.scene.paint.PhongMaterial.setSpecularColor方法的典型用法代码示例。如果您正苦于以下问题:Java PhongMaterial.setSpecularColor方法的具体用法?Java PhongMaterial.setSpecularColor怎么用?Java PhongMaterial.setSpecularColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.paint.PhongMaterial
的用法示例。
在下文中一共展示了PhongMaterial.setSpecularColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AxisOrientation
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
public AxisOrientation(int size) {
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);
final Box xAxis = new Box(size + 100, 2, 2);
final Box yAxis = new Box(2, size + 100, 2);
final Box zAxis = new Box(2, 2, size + 100);
xAxis.setMaterial(redMaterial);
yAxis.setMaterial(greenMaterial);
zAxis.setMaterial(blueMaterial);
this.getChildren().addAll(xAxis, yAxis, zAxis);
}
示例2: buildGroup
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
@Override
protected Group buildGroup() {
mb = new MeshBuilder();
triangleMesh = mb.getTriangleMesh();
meshView = new MeshView(triangleMesh);
material = new PhongMaterial();
material.setDiffuseColor(Color.LIGHTGRAY);
material.setSpecularColor(Color.rgb(30, 30, 30));
meshView.setMaterial(material);
//Set Wireframe mode
meshView.setDrawMode(DrawMode.FILL);
meshView.setCullFace(CullFace.BACK);
meshView.setScaleX(SCALE);
meshView.setScaleY(SCALE);
meshView.setScaleZ(SCALE);
grp = new Group(meshView);
return grp;
}
示例3: initMaterials
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
private void initMaterials() {
topMtrl = new PhongMaterial();
topMtrl.setDiffuseColor(Color.LIGHTGRAY);
topMtrl.setSpecularColor(Color.rgb(30, 30, 30));
bottomMtrl = new PhongMaterial();
bottomMtrl.setDiffuseColor(Color.RED);
bottomMtrl.setSpecularColor(Color.rgb(30, 30, 30));
leftMtrl = new PhongMaterial();
leftMtrl.setDiffuseColor(Color.YELLOW);
leftMtrl.setSpecularColor(Color.rgb(30, 30, 30));
rightMtrl = new PhongMaterial();
rightMtrl.setDiffuseColor(Color.BLUE);
rightMtrl.setSpecularColor(Color.rgb(30, 30, 30));
frontMtrl = new PhongMaterial();
frontMtrl.setDiffuseColor(Color.GREEN);
frontMtrl.setSpecularColor(Color.rgb(30, 30, 30));
backMtrl = new PhongMaterial();
backMtrl.setDiffuseColor(Color.AQUA);
backMtrl.setSpecularColor(Color.rgb(30, 30, 30));
borderMtrl = new PhongMaterial();
borderMtrl.setDiffuseColor(Color.BLACK);
borderMtrl.setSpecularColor(Color.rgb(30, 30, 30));
}
示例4: buildGroup
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
private static Group buildGroup() {
Sphere s = new Sphere();
s.setScaleX(SCALE);
s.setScaleY(SCALE);
s.setScaleZ(SCALE);
PhongMaterial material = new PhongMaterial();
material.setDiffuseColor(Color.LIGHTGRAY);
material.setSpecularColor(Color.rgb(30, 30, 30));
s.setMaterial(material);
// PointLight pl = new PointLight(Color.AQUA);
// pl.setTranslateZ(-1000);
Group group = new Group(/*pl,*/ s);
group.setTranslateX(SS_WIDTH / 2);
group.setTranslateY(SS_HEIGHT / 2);
return group;
}
示例5: 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();
}
示例6: modify
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
@Override
public void modify(Group element) {
// Get the properties
int red = (int) parent.getProperty(PROPERTY_NAME_RED);
int green = (int) parent.getProperty(PROPERTY_NAME_GREEN);
int blue = (int) parent.getProperty(PROPERTY_NAME_BLUE);
// If all properties are valid, set the group's color
if (red >= 0 && green >= 0 && blue >= 0) {
// Create a material of the specified color and set it.
PhongMaterial material = new PhongMaterial(
Color.rgb(red, green, blue));
material.setSpecularColor(Color.WHITE);
// Set the material for the group and pass it along
setMaterial(element, material);
}
}
示例7: buildAxes
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
private void buildAxes() {
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);
final Box xAxis = new Box(240.0, 1, 1);
final Box yAxis = new Box(1, 240.0, 1);
final Box zAxis = new Box(1, 1, 240.0);
xAxis.setMaterial(redMaterial);
yAxis.setMaterial(greenMaterial);
zAxis.setMaterial(blueMaterial);
axisGroup.getChildren().addAll(xAxis, yAxis, zAxis);
world.getChildren().addAll(axisGroup);
}
示例8: buildGroup
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
@Override
protected Group buildGroup() {
material = new PhongMaterial();
material.setDiffuseColor(Color.LIGHTGRAY);
material.setSpecularColor(Color.rgb(30, 30, 30));
grp = new Group();
setShape(Shape.Sphere);
return grp;
}
示例9: initMaterial
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
private void initMaterial() {
material = new PhongMaterial();
material.setDiffuseColor(Color.LIGHTGRAY);
material.setSpecularColor(Color.rgb(30, 30, 30));
shape.setMaterial(material);
}
示例10: buildGroup
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
private static Group buildGroup() {
Group grp = new Group();
Sphere s = new Sphere();
Box b = new Box();
s.setScaleX(SCALE);
s.setScaleY(SCALE);
s.setScaleZ(SCALE);
s.setTranslateX(-130);
b.setScaleX(SCALE);
b.setScaleY(SCALE);
b.setScaleZ(SCALE);
b.setTranslateX(130);
PhongMaterial material = new PhongMaterial();
material.setDiffuseColor(Color.LIGHTGRAY);
material.setSpecularColor(Color.rgb(30, 30, 30));
s.setMaterial(material);
b.setMaterial(material);
PointLight pl = new PointLight(Color.AQUA);
pl.setTranslateZ(-1000);
Sphere lightBalance = new Sphere();
// lightBalance.setScaleX(0.1);
// lightBalance.setScaleX(0.1);
// lightBalance.setScaleX(0.1);
lightBalance.setTranslateZ(1000);
grp.getChildren().addAll(s, b,pl,lightBalance);
return grp;
}
示例11: buildAxes
import javafx.scene.paint.PhongMaterial; //导入方法依赖的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);
}
示例12: getMaterial
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
public static PhongMaterial getMaterial(String face){
PhongMaterial arrowMat = new PhongMaterial();
arrowMat.setSpecularColor(Color.WHITESMOKE);
Color color = Color.WHITE;
switch(face){
case "F":
case "Fi": color = Color.BLUE.brighter();
break;
case "B":
case "Bi": color = Color.BLUE.brighter();
break;
case "R":
case "Ri": color = Color.RED.brighter();
break;
case "L":
case "Li": color = Color.RED.brighter();
break;
case "U":
case "Ui": color = Color.FORESTGREEN.brighter();
break;
case "D":
case "Di": color = Color.FORESTGREEN.brighter();
break;
case "Z":
case "Zi": color = Color.BLUE.brighter();
break;
case "X":
case "Xi": color = Color.RED.brighter();
break;
case "Y":
case "Yi": color = Color.FORESTGREEN.brighter();
break;
}
arrowMat.setDiffuseColor(color);
return arrowMat;
}
示例13: 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);
}
}
}
}
}
示例14: clearMaterialAndSetDiffMap
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
private void clearMaterialAndSetDiffMap(PhongMaterial mat, Image diff){
mat.setBumpMap(null);
mat.setSpecularMap(null);
mat.setSelfIlluminationMap(null);
mat.setDiffuseColor(DEFAULT_DIFFUSE_COLOR);
mat.setSpecularColor(DEFAULT_SPECULAR_COLOR);
mat.setDiffuseMap(diff);
}
示例15: 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;
}