本文整理汇总了Java中javafx.scene.paint.PhongMaterial.setBumpMap方法的典型用法代码示例。如果您正苦于以下问题:Java PhongMaterial.setBumpMap方法的具体用法?Java PhongMaterial.setBumpMap怎么用?Java PhongMaterial.setBumpMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.paint.PhongMaterial
的用法示例。
在下文中一共展示了PhongMaterial.setBumpMap方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildScene
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
private Group buildScene() {
Sphere mars = new Sphere(MARS_RADIUS);
mars.setTranslateX(VIEWPORT_SIZE / 2d);
mars.setTranslateY(VIEWPORT_SIZE / 2d);
PhongMaterial material = new PhongMaterial();
material.setDiffuseMap(
new Image(this.getClass().getResource(DIFFUSE_MAP).toExternalForm(),
MAP_WIDTH,
MAP_HEIGHT,
true,
true
)
);
material.setBumpMap(
new Image(this.getClass().getResource(NORMAL_MAP).toExternalForm(),
MAP_WIDTH,
MAP_HEIGHT,
true,
true
)
);
/*
material.setSpecularMap(
new Image(this.getClass().getResource(SPECULAR_MAP).toExternalForm(),
MAP_WIDTH,
MAP_HEIGHT,
true,
true
)
);
*/
mars.setMaterial(
material
);
return new Group(mars);
}
示例2: 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;
}
示例3: 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);
}
示例4: clearMaterialAndSetColor
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
private void clearMaterialAndSetColor(PhongMaterial mat, Color col){
mat.setBumpMap(null);
mat.setSpecularMap(null);
mat.setSelfIlluminationMap(null);
mat.setDiffuseMap(null);
mat.setDiffuseColor(col);
}
示例5: setMaterial
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
public static void setMaterial(final Planetoid _planetoid, final String _phongFile) {
final PhongMaterial material = new PhongMaterial();
String diffFile = "", normFile = "", specFile = "";
try {
URL url = MediaHelper.getURLForMedia(_phongFile);
JSONParser parser = new JSONParser();
MediaHelper.addToSearchPath(url.getPath().substring(0, url.getPath().lastIndexOf('/')));
Object obj = parser.parse(MediaHelper.getContentAsString(url));
if(obj == null)
return;
JSONObject jsonObject = (JSONObject) obj;
if((diffFile = (String) jsonObject.get("diffuse")) != null)
material.setDiffuseMap(new Image(MediaHelper.getURLForFile(diffFile).toExternalForm(), MAP_WIDTH, MAP_HEIGHT, true, true));
if((normFile = (String) jsonObject.get("normal")) != null)
material.setBumpMap(new Image(MediaHelper.getURLForFile(normFile).toExternalForm(), MAP_WIDTH, MAP_HEIGHT, true, true));
if((specFile = (String) jsonObject.get("specular")) != null)
material.setSpecularMap(new Image(MediaHelper.getURLForFile(specFile).toExternalForm(), MAP_WIDTH, MAP_HEIGHT, true, true));
} catch(ParseException e) { e.printStackTrace(); }
_planetoid.setMaterial(material);
}
示例6: 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);
}
示例7: clearMaterialAndSetColor
import javafx.scene.paint.PhongMaterial; //导入方法依赖的package包/类
private void clearMaterialAndSetColor(PhongMaterial mat, Color col){
mat.setBumpMap(null);
mat.setSpecularMap(null);
mat.setSelfIlluminationMap(null);
mat.setDiffuseMap(null);
mat.setDiffuseColor(col);
}