我想创建一个具有均匀发光的 PhongMaterial。效果是,我有一个小型地球模型,我想用廉价的极光仿制品围绕它。 https://i1.wp.com/trendintech.com/wp-content/uploads/2017/07/Screen-Shot-2017-07-09-at-12.06.23.png?fit=1079%2C742。耀斑不是必需的或不需要的,我只想要围绕它的淡绿色球体。
我本来想用白色做这个的方法就是
public static Sphere buildGlowingSphere(double radius) {
String glowingFilename = "white_square_400x400.jpg";
Image glowingMap = new Image(new File(glowingFilename).toURI().toString());
PhongMaterial material = new PhongMaterial();
material.setDiffuseColor(Color.rgb(255, 255, 255, 0.01));
material.setSpecularColor(Color.rgb(255, 255, 255, 0.01));
material.setSelfIlluminationMap(glowingMap);
Sphere sphere = new Sphere(radius);
sphere.setMaterial(material);
return sphere;
}
然而,这只会产生一个不透明的白色球体。我需要什么使它透明且非常微妙?
当我们这样做时,我不想为我想要制作的每种颜色都提供一个新图像。我想做类似的事情
public static Sphere buildGlowingSphere2(double radius, Color color) {
Image glowingMap = generateBlankImage(color);
PhongMaterial material = new PhongMaterial();
material.setDiffuseColor(Color.rgb(255, 255, 255, 0.01));
material.setSpecularColor(Color.rgb(255, 255, 255, 0.01));
material.setSelfIlluminationMap(glowingMap);
Sphere sphere = new Sphere(radius);
sphere.setMaterial(material);
return sphere;
}
我怎么做?或者以其他方式制作一种均匀自发光的材料?
我也尝试过仅使用未照明的透明球体来做到这一点,这看起来不错,但它没有您在该图像中看到的明亮肢体;它看起来就像一个覆盖地球的扁平圆圈。我认为这是因为在现实生活中,这种材料是发光的。但是,如果有不同或更好的方法来达到相同的效果,我会全力以赴。