#include "rmannotes.sl" #include "shapes.sl" #include "pinky.sl" // time.sl surface time(float hour = 10, min = 12, radius = 0.35, translucent = 0.7; point center = point(0.45, 0.5, 0)) { color green = color(0.7451, 0.8078, 0.8431); color lightblack = color(0.2824, 0.2667, 0.2706); color black = color(0.0039, 0.0039, 0.0039); color white = color(1.0000, 1.0000, 1.0000); float opaque = 1.0, fuzz = 0.005; float angle, ss, tt; color surface_color, layer_color; color surface_opac, layer_opac; // pinky background layer surface_color = pinky(); rotate2d(s, t, radians(-25), 0.5, 0.45, ss, tt); surface_opac = butterfly(0.45, fuzz, s, t, point(center[0]-0.1, center[1]-0.05, center[2])); // the clock layer_color = lightblack; layer_opac = disk(radius, fuzz, s, t, center); surface_color = blend(surface_color, layer_color, layer_opac*translucent); rotate2d(s, t, radians(15), 0.5, 0.45, ss, tt); layer_color = spline(tt, white, white, white, white, white, white, black, white, white, white, white, white, white, white); layer_opac = ring(radius, radius+0.05, fuzz, s, t, center); surface_color = blend(surface_color, layer_color, layer_opac*translucent); layer_color = green; layer_opac = 0.0; float width = radius*0.3, height = radius*0.1; for ( angle = 0; angle <360; angle += 90) { rotate2d(s, t, radians(angle), center[0], center[1], ss, tt); layer_opac = union(layer_opac, rect(center[0]+radius*0.6, center[1]-height/2.0, width, height, fuzz, ss, tt)); surface_color = blend(surface_color, layer_color, layer_opac*translucent); } layer_color = white; layer_opac = disk(radius/5.0, fuzz/2.0, s, t, point(center[0], center[1]-radius*0.7, center[2])); surface_color = blend(surface_color, layer_color, layer_opac*translucent); // hour hand angle = 30*(3-hour); rotate2d(s, t, radians(angle), center[0], center[1], ss, tt); layer_opac = line(center, point(center[0]+radius/2.0, center[1], center[2]), fuzz*4, fuzz, ss, tt); angle = 6*(15-min); rotate2d(s, t, radians(angle), center[0], center[1], ss, tt); layer_opac = union(layer_opac, line(center, point(center[0]+radius/1.5, center[1], center[2]), fuzz*3, fuzz, ss, tt)); surface_color = blend(surface_color, layer_color, layer_opac*translucent); // output Oi = surface_opac; Ci = surface_opac * surface_color; }