Copyright 2012 Mobialia
http://www.mobialia.com/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to ...
If you think the Android project jmini3d listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package jmini3d.material;
/*fromwww.java2s.com*/import jmini3d.Color4;
import jmini3d.Texture;
/**
* A material with PHONG lighting
*/publicclass PhongMaterial extends Material {
// alpha is intensity
public Color4 ambient;
public Color4 diffuse;
public Color4 specular;
publicfloat shininess = 8;
public PhongMaterial(Color4 ambient, Color4 diffuse, Color4 specular) {
super(new Color4(255, 255, 255, 255));
this.ambient = ambient;
this.diffuse = diffuse;
this.specular = specular;
}
public PhongMaterial(Texture texture, Color4 ambient, Color4 diffuse, Color4 specular) {
super(texture);
this.ambient = ambient;
this.diffuse = diffuse;
this.specular = specular;
}
public PhongMaterial(Texture texture, Color4 ambient, Color4 diffuse, Color4 specular, float shininess) {
super(texture);
this.ambient = ambient;
this.diffuse = diffuse;
this.specular = specular;
this.shininess = shininess;
}
}