gerardsimons / CGA_Game

The final project for the TU Delft course Computer Graphics and Animation
0 stars 0 forks source link

Requirement 2 - Terrain #3

Open NathanMol opened 11 years ago

NathanMol commented 11 years ago

2. The ground

gerardsimons commented 11 years ago

Ben hier nu even mee aan de slag...

NathanMol commented 11 years ago

Phong

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; }

procedual generated 3d terrain

I would suggest to take something like this (function: y^2+x^2), in a periodic manner: terrain_function

More information can be found here

You could for example stretch this area, by tweaking this formula; -(y^2+5*x^2), produces: terrain_function2

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!

NathanMol commented 11 years ago

Check 3e requirement: phong op terrain