本文整理汇总了Java中javax.vecmath.Color3f.scale方法的典型用法代码示例。如果您正苦于以下问题:Java Color3f.scale方法的具体用法?Java Color3f.scale怎么用?Java Color3f.scale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.vecmath.Color3f
的用法示例。
在下文中一共展示了Color3f.scale方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setColor
import javax.vecmath.Color3f; //导入方法依赖的package包/类
/** Set the object color */
@Override
public void setColor(Color3f color) {
Material mat = appearance.getMaterial();
Color3f ambient = new Color3f(color);
ambient.scale(0.3f);
mat.setAmbientColor(ambient);
color.clampMax(0.8f);
mat.setDiffuseColor(color);
// No specular color
Color3f specular = new Color3f(0, 0, 0);
mat.setSpecularColor(specular);
mat.setShininess(1f);
}
示例2: setColor
import javax.vecmath.Color3f; //导入方法依赖的package包/类
/** Set the object color */
@Override
public void setColor(Color3f color) {
Material mat = appearance.getMaterial();
Color3f ambient = new Color3f(color);
ambient.scale(0.3f);
mat.setAmbientColor(ambient);
color.clampMax(0.8f);
mat.setDiffuseColor(color);
// No specular color
Color3f specular = new Color3f(0, 0, 0);
mat.setSpecularColor(specular);
mat.setShininess(1f);
}
示例3: createAppearance
import javax.vecmath.Color3f; //导入方法依赖的package包/类
private Appearance createAppearance(float R, float G, float B) {
Appearance appearance = new Appearance();
Color3f color3f = new Color3f(R /255, G /255, B /255);
Color3f ambient = new Color3f(color3f);
ambient.scale(0.5f);
Color3f noColor = new Color3f(0f, 0f, 0f);
Material material = new Material(noColor, noColor, color3f, noColor, 1); // ambient, emissive, diffuse, specular, shininess
material.setLightingEnable(true);
appearance.setMaterial(material);
appearance.setPolygonAttributes(getAppearance().getPolygonAttributes());
return appearance;
}