Open NathanMol opened 11 years ago
Ben hier nu even mee aan de slag...
case SPECULAR_LIGHTING:
{
// Blinn Phong - specular
// http://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model
// Viewpoint : CamPos
// H = (L+V)/(|L+V|)
// -> (NH)^s
//s=1.0;
Vec3Df h = (vertexPos+CamPos)/(vertexPos.getLength()+CamPos.getLength());
float NdotH = Vec3Df::dotProduct(normal, h);
float intensity = pow( NdotH, s );
//std::cout << "s: " << s << " I: " << intensity << std::endl;
return LightColor[light] \ intensity;
}
I would suggest to take something like this (function: y^2+x^2), in a periodic manner:
More information can be found here
You could for example stretch this area, by tweaking this formula; -(y^2+5*x^2), produces:
This website provides another nice tool to play along with those area-shapes. Like for instance the cos(xy)(x^2-y^2) shape looks also quite nice!
Check 3e requirement: phong op terrain
2. The ground