#include "rmannotes.sl" surface rock2( float groovyness = .2, therock = 1, metalness = 1) { color layer_color, surface_color, layer_opac, metal, boo1, boo2, hand_color, layer_color2, surface_color2 = color (0,0,0), layer_opac2; float ss, tt, fuzz = 0.005, r, th, radius, half_width, d, ring, row, column, freq = 10; point center; point p1, p2; surface_color = color "hsv" (1, 1, t*.45); //distorto-ray numero uno! topolar2d(s*2-.3, t-.7, r, th); layer_color = color "hsv" (0.4, r, r); r = repeat(r, 5); th = repeat(th, 5); layer_opac = pulse(.3, .9, fuzz, r); boo1 = layer_opac; surface_color = blend(surface_color, layer_color, layer_opac*groovyness); //distorto-ray numero dos! topolar2d(s-.8, 2*t-.2, r, th); layer_color = color "hsv" (0.9, r, r); r = repeat(r, 5); th = repeat(th, 5); layer_opac = pulse(.1, .7, fuzz, r); boo2 = layer_opac; surface_color = blend(surface_color, layer_color, layer_opac*groovyness); //I hate these distorto rays! I'd rather rock out ss = repeat(s, metalness); tt = repeat(t, metalness); tt = mod(tt - 0.08, 1); column = whichtile(s, metalness); row = whichtile(t, metalness); if (odd(row)) { ss = mod(ss + 0.5, 1); } /* if (odd(row) && even(column)) { hand_color = (1,0,0); } else { hand_color = (1,1,1); } */ hand_color = (1,1,1); //begin rock out //hand squares layer_color2 = hand_color; layer_opac = intersection( pulse( .3, .7, fuzz, ss), pulse(.3, .7, fuzz, tt)); layer_opac2 = intersection( pulse( .3, .7, fuzz, ss), pulse(.3, .7, fuzz, tt)); surface_color2 = blend(surface_color2, layer_color2, layer_opac); layer_opac = intersection( pulse( .6, .7, fuzz, ss), pulse(.1, .7, fuzz, tt)); layer_opac2 = union(layer_opac2, layer_opac); surface_color2 = blend(surface_color2, layer_color2, layer_opac); layer_opac = intersection( pulse( .3, .4, fuzz, ss), pulse(.1, .7, fuzz, tt)); layer_opac2 = union(layer_opac2, layer_opac); surface_color2 = blend(surface_color2, layer_color2, layer_opac); layer_opac = intersection( pulse( .25, .4, fuzz, ss), pulse(.4, .6, fuzz, tt)); layer_opac2 = union(layer_opac2, layer_opac); surface_color2 = blend(surface_color2, layer_color2, layer_opac); //thumball center = point (0.34, 0.61, 0); radius = 0.1; d = distance(center, point (ss, tt, 0)); layer_opac = 1 - smoothstep(radius - fuzz, radius, d); layer_opac2 = union(layer_opac2, layer_opac); surface_color2 = blend(surface_color2, layer_color2, layer_opac); //line layers layer_color2 = color(0,0,0); //from left to right finger lines p1 = point (0.4, 0.3, 0); p2 = point (0.4, 0.5, 0); half_width = 0.005; d = ptlined(p1, p2, point (ss, tt, 0)); layer_opac = 1 - smoothstep(half_width - fuzz, half_width, d); layer_opac2 = union(layer_opac2, layer_opac); surface_color2 = blend(surface_color2, layer_color2, layer_opac); p1 = point (0.5, 0.3, 0); p2 = point (0.5, 0.5, 0); half_width = 0.005; d = ptlined(p1, p2, point (ss, tt, 0)); layer_opac = 1 - smoothstep(half_width - fuzz, half_width, d); layer_opac2 = union(layer_opac2, layer_opac); surface_color2 = blend(surface_color2, layer_color2, layer_opac); p1 = point (0.594, 0.3, 0); p2 = point (0.594, 0.5, 0); half_width = 0.005; d = ptlined(p1, p2, point (ss, tt, 0)); layer_opac = 1 - smoothstep(half_width - fuzz, half_width, d); layer_opac2 = union(layer_opac2, layer_opac); surface_color2 = blend(surface_color2, layer_color2, layer_opac); //bottom of mid fingers p1 = point (0.4, 0.5, 0); p2 = point (0.594, 0.5, 0); half_width = 0.005; d = ptlined(p1, p2, point (ss, tt, 0)); layer_opac = 1 - smoothstep(half_width - fuzz, half_width, d); layer_opac2 = union(layer_opac2, layer_opac); surface_color2 = blend(surface_color2, layer_color2, layer_opac); //thumb across mid fingers layer_color2 = hand_color; layer_opac = intersection( pulse( .25, .43, fuzz, ss), pulse(.4, .6, fuzz, tt)); layer_opac2 = union(layer_opac2, layer_opac); surface_color2 = blend(surface_color2, layer_color2, layer_opac); //thumb lines layer_color2 = color(0,0,0); p1 = point (0.25, 0.4, 0); p2 = point (0.45, 0.4, 0); half_width = 0.005; d = ptlined(p1, p2, point (ss, tt, 0)); layer_opac = 1 - smoothstep(half_width - fuzz, half_width, d); layer_opac2 = union(layer_opac2, layer_opac); surface_color2 = blend(surface_color2, layer_color2, layer_opac); p1 = point (0.42, 0.51, 0); p2 = point (0.45, 0.4, 0); half_width = 0.005; d = ptlined(p1, p2, point (ss, tt, 0)); layer_opac = 1 - smoothstep(half_width - fuzz, half_width, d); layer_opac2 = union(layer_opac2, layer_opac); surface_color2 = blend(surface_color2, layer_color2, layer_opac); p1 = point (0.42, 0.51, 0); p2 = point (0.35, 0.51, 0); half_width = 0.005; d = ptlined(p1, p2, point (ss, tt, 0)); layer_opac = 1 - smoothstep(half_width - fuzz, half_width, d); layer_opac2 = union(layer_opac2, layer_opac); surface_color2 = blend(surface_color2, layer_color2, layer_opac); surface_color = blend(surface_color, surface_color2, layer_opac2*therock ); Ci = surface_color; }