Multi-scale Function Adding Noise over diverse frequencies and amplitudes )) * , * , * ( * ) , , ( 1 r scale t scale s scale noise amplitude r t s f i i i bands i i å = - =
Sum of Absolute Values Adding Noise over absolute values is Good for fire )) , , ( ( ) , , ( 1 r scale t scale s scale noise amplitude r t s f i i i bands i i å = - =
Marble Example § MarbleMap is from black to white § Scale scales [min, max] to [0,1] § u and v are in range [0,1] § Does not look that great, maybe a more complex color ramp is needed )) ) 5 . 11 , * 2 * 5 , * 2 * 5 ( * 2 * 6 * 20 sin ( ( ) , ( 4 1 ÷ ø ö ç è æ + = å = - v u PNoise u Scale MarbleMap v u Texture i i i i
§Axis-aligned Bounding Box (AABB) § An AABB is defined by its minimal and maximal positions in space Pmin=(xmin, ymin, zmin), Pmax = (xmax, ymax, zmax) § Calculate Initialize pmin to +infinite or the first vertex Initialize pmax to –infinite or the first vertex foreach vertex p do { if (p.x < pmin.x) then pmin.x = p.x if (p.y < pmin.y) then pmin.y = p.y if (p.z > pmax.z) then pmax.z = p.z }
Fog glEnable(GL_FOG); // specifies the equation to be used to compute the fog blend factor. // GL_LINEAR, GL_EXP, and GL_EXP2. // initial fog mode is GL_EXP glFogi(GL_FOG_MODE, GL_LINEAR); // the fog color. Color components are in the range [0,1]. // the initial fog color is (0, 0, 0, 0). GLfloat fogColor[4] = { 0.5, 0.5, 0.5, 1.0 }; glFogfv(GL_FOG_COLOR, fogColor); //Used in exponential fog equations. The initial fog density is 1. // Only nonnegative densities are accepted. glFogf(GL_FOG_DENSITY, 0.25); // the near distance used in the linear fog equation. The initial near distance is 0 glFogf(GL_FOG_START, 10.0); // the far distance used in the linear fog equation. The initial far distance is 1. glFogf(GL_FOG_END, 6000.0);
Problem B https://github.com/javiergs/SER431/blob/master/Lecture20/nurbs_surface_controlled.cpp * There are 7 squares (i.e., 7 curves)in blue. * You need 8 control points per square; BUT since you want to close the curve. You may should need to add the first one again. Thus 8 + 1