File: background.pic

package info (click to toggle)
surf-alggeo 1.0.6%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,976 kB
  • sloc: cpp: 22,587; yacc: 1,049; makefile: 517; lex: 327; ansic: 237; sh: 95
file content (101 lines) | stat: -rw-r--r-- 1,580 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// -------------------------------
//  The Clebsch diagonal surface:
//  a smooth cubic surface
//  admitting the symmetry
//  of the tetrahedron
// -------------------------------

//  set image size 
illumination = ambient_light+diffuse_light+transmitted_light+reflected_light;
width =400;
height=400;
set_size;
curve_red=100;
curve_green=50;
curve_blue=0;
//  define some useful constants

double  w2=sqrt(2.0); 
double  Pi=2*arccos(0);

//  define tetrahedral coordinates

poly p=1-z-w2*x;
poly q=1-z+w2*x;
poly r=1+z+w2*y;
poly s=1+z-w2*y;

//  symmetric polynomials 

poly c1=p  +q  +r  -s;
poly c2=p^3+q^3+r^3-s^3;

//  fix rotation

first  = translate;
second = rotate;
third  = scale;

rot_x=-0.5;
rot_y= 4.35;
rot_z=-0.58+Pi;

//  fix scaling

double  sf = 0.6;

scale_x=sf;
scale_y=sf*0.5;
scale_z=sf;

//  visible area and perspective

depth_cueing=yes;
depth=-20;
radius=9;
spec_z=30;
perspective=central;
antialiasing=4;

// fix light

ambient   =20;
diffuse   =60;
reflected =70;
smoothness=30;

light1_x  =-100;
light1_y  = 100;
light1_z  = 100;
light1_vol=  80;

light3_x  = 100;
light3_y  =  20;
light3_z  =  50;
light3_vol=  60;

light8_x  =-100;
light8_y  = 100;
light8_z  = 100;
light8_vol=  20;

//   surface color

//  define the diagonal surface

poly clebsch = c2 - c1^3;
surface=clebsch;

//  draw the surface

clear_screen;
cutsurface1=rotate(clebsch,1.0,xAxis);
// surface2=cutsurface1;
draw_surface;
curve_width=6;
cut_with_surface;

filename="| rasttopnm | ppmtoxpm >surf.xpm";
color_file_format=sun;
color_file_colormap=Optimized;
save_color_image;