ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/gb-bilayer/pov/SystemA_header.pov
Revision: 2683
Committed: Mon Apr 3 15:39:57 2006 UTC (18 years, 3 months ago) by tim
File size: 21673 byte(s)
Log Message:
Imported using TkCVS

File Contents

# User Rev Content
1 tim 2683 // The following script was automatically generated by:
2     // xyz2pov Copyright 2001 by MATTHEW A. MEINEKE
3     #include "colors.inc"
4     #include "math.inc"
5    
6    
7     background { rgb <1.0, 1.0, 1.0> }
8    
9    
10     //******************************************************
11     // Declare the resolution, camera, and light sources.
12     //******************************************************
13    
14     // NOTE: if you plan to render at a different resoltion,
15     // be sure to update the following two lines to maintain
16     // the correct aspect ratio.
17    
18     #declare Width = 500.0;
19     #declare Height = 500.0;
20     #declare Ratio = Width / Height;
21     #declare zoom = 50;
22     #declare FIELD_OF_VIEW = 1.75;
23     #declare VIEW_ANGLE = atan(2*FIELD_OF_VIEW/zoom)*57.2958;
24    
25     #declare ATOM_SPHERE_FACTOR = 0.2;
26     #declare BOND_RADIUS = 0.1;
27     #declare VECTOR_SCALE = 1.0;
28     #declare STICK_RADIUS = 0.5 * BOND_RADIUS;
29     #declare CONE_RADIUS = 2.0 * STICK_RADIUS;
30     #declare CONE_FRACTION = 0.15;
31    
32     // declare camera, light, and system variables
33    
34     #declare sysCenterX = 0.500346;
35     #declare sysCenterY = 0.500000;
36     #declare sysCenterZ = 0.500271;
37    
38     #declare zoom = 4.865521;
39    
40     #declare cameraLookX = sysCenterX;
41     #declare cameraLookY = sysCenterY;
42     #declare cameraLookZ = sysCenterZ;
43    
44     #declare rotatePointX = cameraLookX;
45     #declare rotatePointY = cameraLookY;
46     #declare rotatePointZ = cameraLookZ;
47    
48     #declare cameraX = cameraLookX;
49     #declare cameraY = cameraLookY;
50     #declare cameraZ = cameraLookZ - zoom;
51    
52     #declare lightAx = cameraX;
53     #declare lightAy = cameraY;
54     #declare lightAz = cameraZ;
55    
56     #declare lightBx = cameraX - zoom;
57     #declare lightBy = cameraY + zoom;
58     #declare lightBz = cameraZ;
59    
60     #declare boxCenterX = cameraLookX;
61     #declare boxCenterY = cameraLookY;
62     #declare boxCenterZ = cameraLookZ;
63     #declare fn = function(x,y,z) {(y+1)/2}
64     #declare grad1 = pigment { function { fn(x, y, z) } color_map {[0.0 rgb <0,0,0>] [1.0 rgb <3,0,0>]} };
65     #declare grad2 = pigment { function { fn(x, y, z) } rotate 120*z color_map {[0.0 rgb <0,0,0>] [1.0 rgb <0,3,0>]} };
66     #declare grad3 = pigment { function { fn(x, y, z) } rotate 240*z color_map {[0.0 rgb <0,0,0>] [1.0 rgb <0,0,3>]} };
67     #declare fnz = function(x,y,z) {(z+1)/2}
68     #declare gradz = pigment { function { fnz(x, y, z) } color_map {[0.0 rgb <0,0,0>] [1.0 rgb <1,1,1>]} };
69     #declare fn2 = function(x,y,z) {
70     (z<-0.806) * 0.33 +
71     (z>=-0.8)*(y>=0.01) * 0.66 +
72     (z>=-0.8)*(y<=-0.01) * 1.0
73     }
74    
75     // declare the cameras and the light sources
76    
77     camera{
78     perspective
79     location < cameraX, cameraY, cameraZ> * zoom
80     angle VIEW_ANGLE
81     right < Ratio , 0, 0>
82     look_at < cameraLookX, cameraLookY, cameraLookZ >
83     }
84    
85     light_source{
86     < lightAx, lightAy, lightAz >
87     rgb < 1.0, 1.0, 1.0 > }
88    
89     light_source{
90     < lightBx, lightBy, lightBz >
91     rgb < 1.0, 1.0, 1.0 > }
92    
93    
94     //************************************************************
95     // Set whether or not to rotate the system.
96     //
97     // To Rotate, set ROTATE to 1.0 (true),
98     // Then set the Euler Angles PHI, THETA, and PSI in degrees.
99     //************************************************************
100    
101     #declare ROTATE = 1.0;
102     #declare PHI = 0.0;
103     #declare THETA = 180.0;
104     #declare PSI = 0.0;
105    
106     #if(ROTATE)
107     #declare phi_r = radians(PHI);
108     #declare theta_r = radians(THETA);
109     #declare psi_r = radians(PSI);
110    
111     #declare A11 = cos(phi_r) * cos(psi_r) - sin(phi_r) * cos(theta_r) * sin(psi_r);
112     #declare A12 = sin(phi_r) * cos(psi_r) + cos(phi_r) * cos(theta_r) * sin(psi_r);
113     #declare A13 = sin(theta_r) * sin(psi_r);
114    
115     #declare A21 = -cos(phi_r) * sin(psi_r) - sin(phi_r) * cos(theta_r) * cos(psi_r);
116     #declare A22 = -sin(phi_r) * sin(psi_r) + cos(phi_r) * cos(theta_r) * cos(psi_r);
117     #declare A23 = sin(theta_r) * cos(psi_r);
118    
119     #declare A31 = sin(phi_r) * sin(theta_r);
120     #declare A32 = -cos(phi_r) * sin(theta_r);
121     #declare A33 = cos(theta_r);
122    
123     #end
124    
125    
126     //************************************************************
127     // declare the periodic box macro
128     //************************************************************
129    
130     #macro makePeriodicBox( bx1, by1, bz1, bx2, by2, bz2, bx3, by3, bz3 )
131    
132     #local bcx = (bx1 + bx2 + bx3) / 2.0;
133     #local bcy = (by1 + by2 + by3) / 2.0;
134     #local bcz = (bz1 + bz2 + bz3) / 2.0;
135    
136     #local pAx = boxCenterX - bcx;
137     #local pAy = boxCenterY - bcy;
138     #local pAz = boxCenterZ - bcz;
139     #local pBx = boxCenterX + bx1 - bcx;
140     #local pBy = boxCenterY + by1 - bcy;
141     #local pBz = boxCenterZ + bz1 - bcz;
142     #local pCx = boxCenterX + bx2 - bcx;
143     #local pCy = boxCenterY + by2 - bcy;
144     #local pCz = boxCenterZ + bz2 - bcz;
145     #local pDx = boxCenterX + bx3 - bcx;
146     #local pDy = boxCenterY + by3 - bcy;
147     #local pDz = boxCenterZ + bz3 - bcz;
148     #local pEx = boxCenterX + bx1 + bx2 - bcx;
149     #local pEy = boxCenterY + by1 + by2 - bcy;
150     #local pEz = boxCenterZ + bz1 + bz2 - bcz;
151     #local pFx = boxCenterX + bx1 + bx3 - bcx;
152     #local pFy = boxCenterY + by1 + by3 - bcy;
153     #local pFz = boxCenterZ + bz1 + bz3 - bcz;
154     #local pGx = boxCenterX + bx2 + bx3 - bcx;
155     #local pGy = boxCenterY + by2 + by3 - bcy;
156     #local pGz = boxCenterZ + bz2 + bz3 - bcz;
157     #local pHx = boxCenterX + bx1 + bx2 + bx3 - bcx;
158     #local pHy = boxCenterY + by1 + by2 + by3 - bcy;
159     #local pHz = boxCenterZ + bz1 + bz2 + bz3 - bcz;
160    
161     #if(ROTATE)
162     #local pAx_new = rotatePointX + A11 * (pAx-rotatePointX) + A12 * (pAy-rotatePointY) + A13 * (pAz-rotatePointZ);
163     #local pAy_new = rotatePointY + A21 * (pAx-rotatePointX) + A22 * (pAy-rotatePointY) + A23 * (pAz-rotatePointZ);
164     #local pAz_new = rotatePointZ + A31 * (pAx-rotatePointX) + A32 * (pAy-rotatePointY) + A33 * (pAz-rotatePointZ);
165    
166     #local pBx_new = rotatePointX + A11 * (pBx-rotatePointX) + A12 * (pBy-rotatePointY) + A13 * (pBz-rotatePointZ);
167     #local pBy_new = rotatePointY + A21 * (pBx-rotatePointX) + A22 * (pBy-rotatePointY) + A23 * (pBz-rotatePointZ);
168     #local pBz_new = rotatePointZ + A31 * (pBx-rotatePointX) + A32 * (pBy-rotatePointY) + A33 * (pBz-rotatePointZ);
169    
170     #local pCx_new = rotatePointX + A11 * (pCx-rotatePointX) + A12 * (pCy-rotatePointY) + A13 * (pCz-rotatePointZ);
171     #local pCy_new = rotatePointY + A21 * (pCx-rotatePointX) + A22 * (pCy-rotatePointY) + A23 * (pCz-rotatePointZ);
172     #local pCz_new = rotatePointZ + A31 * (pCx-rotatePointX) + A32 * (pCy-rotatePointY) + A33 * (pCz-rotatePointZ);
173    
174     #local pDx_new = rotatePointX + A11 * (pDx-rotatePointX) + A12 * (pDy-rotatePointY) + A13 * (pDz-rotatePointZ);
175     #local pDy_new = rotatePointY + A21 * (pDx-rotatePointX) + A22 * (pDy-rotatePointY) + A23 * (pDz-rotatePointZ);
176     #local pDz_new = rotatePointZ + A31 * (pDx-rotatePointX) + A32 * (pDy-rotatePointY) + A33 * (pDz-rotatePointZ);
177    
178     #local pEx_new = rotatePointX + A11 * (pEx-rotatePointX) + A12 * (pEy-rotatePointY) + A13 * (pEz-rotatePointZ);
179     #local pEy_new = rotatePointY + A21 * (pEx-rotatePointX) + A22 * (pEy-rotatePointY) + A23 * (pEz-rotatePointZ);
180     #local pEz_new = rotatePointZ + A31 * (pEx-rotatePointX) + A32 * (pEy-rotatePointY) + A33 * (pEz-rotatePointZ);
181    
182     #local pFx_new = rotatePointX + A11 * (pFx-rotatePointX) + A12 * (pFy-rotatePointY) + A13 * (pFz-rotatePointZ);
183     #local pFy_new = rotatePointY + A21 * (pFx-rotatePointX) + A22 * (pFy-rotatePointY) + A23 * (pFz-rotatePointZ);
184     #local pFz_new = rotatePointZ + A31 * (pFx-rotatePointX) + A32 * (pFy-rotatePointY) + A33 * (pFz-rotatePointZ);
185    
186     #local pGx_new = rotatePointX + A11 * (pGx-rotatePointX) + A12 * (pGy-rotatePointY) + A13 * (pGz-rotatePointZ);
187     #local pGy_new = rotatePointY + A21 * (pGx-rotatePointX) + A22 * (pGy-rotatePointY) + A23 * (pGz-rotatePointZ);
188     #local pGz_new = rotatePointZ + A31 * (pGx-rotatePointX) + A32 * (pGy-rotatePointY) + A33 * (pGz-rotatePointZ);
189    
190     #local pHx_new = rotatePointX + A11 * (pHx-rotatePointX) + A12 * (pHy-rotatePointY) + A13 * (pHz-rotatePointZ);
191     #local pHy_new = rotatePointY + A21 * (pHx-rotatePointX) + A22 * (pHy-rotatePointY) + A23 * (pHz-rotatePointZ);
192     #local pHz_new = rotatePointZ + A31 * (pHx-rotatePointX) + A32 * (pHy-rotatePointY) + A33 * (pHz-rotatePointZ);
193    
194     #else
195     #local pAx_new = pAx; #local pAy_new = pAy; #local pAz_new = pAz;
196     #local pBx_new = pBx; #local pBy_new = pBy; #local pBz_new = pBz;
197     #local pCx_new = pCx; #local pCy_new = pCy; #local pCz_new = pCz;
198     #local pDx_new = pDx; #local pDy_new = pDy; #local pDz_new = pDz;
199     #local pEx_new = pEx; #local pEy_new = pEy; #local pEz_new = pEz;
200     #local pFx_new = pFx; #local pFy_new = pFy; #local pFz_new = pFz;
201     #local pGx_new = pGx; #local pGy_new = pGy; #local pGz_new = pGz;
202     #local pHx_new = pHx; #local pHy_new = pHy; #local pHz_new = pHz;
203     #end
204     #local pAx = pAx_new; #local pAy = pAy_new; #local pAz = pAz_new;
205     #local pBx = pBx_new; #local pBy = pBy_new; #local pBz = pBz_new;
206     #local pCx = pCx_new; #local pCy = pCy_new; #local pCz = pCz_new;
207     #local pDx = pDx_new; #local pDy = pDy_new; #local pDz = pDz_new;
208     #local pEx = pEx_new; #local pEy = pEy_new; #local pEz = pEz_new;
209     #local pFx = pFx_new; #local pFy = pFy_new; #local pFz = pFz_new;
210     #local pGx = pGx_new; #local pGy = pGy_new; #local pGz = pGz_new;
211     #local pHx = pHx_new; #local pHy = pHy_new; #local pHz = pHz_new;
212     #local colorR = 0.90;
213     #local colorG = 0.91;
214     #local colorB = 0.98;
215    
216     #local pipeWidth = 0.005;
217    
218     // 1
219     cylinder{
220     < pAx, pAy, pAz >,
221     < pBx, pBy, pBz >,
222     pipeWidth
223     texture{
224     pigment{ rgb < colorR, colorG, colorB > }
225     finish{
226     ambient .2
227     diffuse .6
228     specular 1
229     roughness .001
230     metallic
231     }
232     }
233     }
234    
235     // 2
236     cylinder{
237     < pAx, pAy, pAz >,
238     < pCx, pCy, pCz >,
239     pipeWidth
240     texture{
241     pigment{ rgb < colorR, colorG, colorB > }
242     finish{
243     ambient .2
244     diffuse .6
245     specular 1
246     roughness .001
247     metallic
248     }
249     }
250     }
251    
252     // 3
253     cylinder{
254     < pAx, pAy, pAz >,
255     < pDx, pDy, pDz >,
256     pipeWidth
257     texture{
258     pigment{ rgb < colorR, colorG, colorB > }
259     finish{
260     ambient .2
261     diffuse .6
262     specular 1
263     roughness .001
264     metallic
265     }
266     }
267     }
268    
269     // 4
270     cylinder{
271     < pBx, pBy, pBz >,
272     < pEx, pEy, pEz >,
273     pipeWidth
274     texture{
275     pigment{ rgb < colorR, colorG, colorB > }
276     finish{
277     ambient .2
278     diffuse .6
279     specular 1
280     roughness .001
281     metallic
282     }
283     }
284     }
285    
286     // 5
287     cylinder{
288     < pCx, pCy, pCz >,
289     < pEx, pEy, pEz >,
290     pipeWidth
291     texture{
292     pigment{ rgb < colorR, colorG, colorB > }
293     finish{
294     ambient .2
295     diffuse .6
296     specular 1
297     roughness .001
298     metallic
299     }
300     }
301     }
302    
303     // 6
304     cylinder{
305     < pBx, pBy, pBz >,
306     < pFx, pFy, pFz >,
307     pipeWidth
308     texture{
309     pigment{ rgb < colorR, colorG, colorB > }
310     finish{
311     ambient .2
312     diffuse .6
313     specular 1
314     roughness .001
315     metallic
316     }
317     }
318     }
319    
320     // 7
321     cylinder{
322     < pCx, pCy, pCz >,
323     < pGx, pGy, pGz >,
324     pipeWidth
325     texture{
326     pigment{ rgb < colorR, colorG, colorB > }
327     finish{
328     ambient .2
329     diffuse .6
330     specular 1
331     roughness .001
332     metallic
333     }
334     }
335     }
336    
337     // 8
338     cylinder{
339     < pDx, pDy, pDz >,
340     < pGx, pGy, pGz >,
341     pipeWidth
342     texture{
343     pigment{ rgb < colorR, colorG, colorB > }
344     finish{
345     ambient .2
346     diffuse .6
347     specular 1
348     roughness .001
349     metallic
350     }
351     }
352     }
353    
354     // 9
355     cylinder{
356     < pDx, pDy, pDz >,
357     < pFx, pFy, pFz >,
358     pipeWidth
359     texture{
360     pigment{ rgb < colorR, colorG, colorB > }
361     finish{
362     ambient .2
363     diffuse .6
364     specular 1
365     roughness .001
366     metallic
367     }
368     }
369     }
370    
371     // 10
372     cylinder{
373     < pEx, pEy, pEz >,
374     < pHx, pHy, pHz >,
375     pipeWidth
376     texture{
377     pigment{ rgb < colorR, colorG, colorB > }
378     finish{
379     ambient .2
380     diffuse .6
381     specular 1
382     roughness .001
383     metallic
384     }
385     }
386     }
387    
388     // 11
389     cylinder{
390     < pFx, pFy, pFz >,
391     < pHx, pHy, pHz >,
392     pipeWidth
393     texture{
394     pigment{ rgb < colorR, colorG, colorB > }
395     finish{
396     ambient .2
397     diffuse .6
398     specular 1
399     roughness .001
400     metallic
401     }
402     }
403     }
404    
405     // 12
406     cylinder{
407     < pGx, pGy, pGz >,
408     < pHx, pHy, pHz >,
409     pipeWidth
410     texture{
411     pigment{ rgb < colorR, colorG, colorB > }
412     finish{
413     ambient .2
414     diffuse .6
415     specular 1
416     roughness .001
417     metallic
418     }
419     }
420     }
421    
422     #end
423    
424    
425     //****************************************************
426     // DEFINE GBDP MACROS
427     //****************************************************
428    
429     #macro make_GBDP_bond (end_1x, end_1y, end_1z, end_2x, end_2y, end_2z)
430    
431     #local x1 = end_1x;
432     #local y1 = end_1y;
433     #local z1 = end_1z;
434     #local x2 = end_2x;
435     #local y2 = end_2y;
436     #local z2 = end_2z;
437    
438     #if(ROTATE)
439     #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
440     #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
441     #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
442    
443     #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);
444     #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);
445     #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);
446    
447     #else
448     #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
449     #local x2_new = x2; #local y2_new = y2; #local z2_new = z2;
450     #end
451    
452     cylinder{
453     < x1_new, y1_new, z1_new >,
454     < x2_new, y2_new, z2_new >,
455     BOND_RADIUS
456     texture{
457     pigment{ rgb < 1.000000, 0.078431, 0.576471 > }
458     finish{
459     ambient .2
460     diffuse .6
461     specular 1
462     roughness .001
463     metallic
464     }
465     }
466     }
467     #end
468     #macro make_GBDP_atom (center_x, center_y, center_z)
469    
470     #local x1 = center_x;
471     #local y1 = center_y;
472     #local z1 = center_z;
473    
474     #if(ROTATE)
475    
476     #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
477     #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
478     #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
479    
480     #else
481    
482     #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
483     #end
484    
485     sphere{
486     < x1_new, y1_new, z1_new >,
487     ATOM_SPHERE_FACTOR * 10.000000
488     texture{
489     pigment{ rgb < 1.000000, 0.078431, 0.576471 > }
490     finish{
491     ambient .2
492     diffuse .6
493     specular 1
494     roughness .001
495     metallic
496     }
497     }
498     }
499     #end
500     #macro make_GBDP_ellipse (center_x, center_y, center_z, ecc, u_x, u_y, u_z)
501    
502     #local x1 = center_x;
503     #local y1 = center_y;
504     #local z1 = center_z;
505     #local x2 = u_x;
506     #local y2 = u_y;
507     #local z2 = u_z;
508    
509     #if(ROTATE)
510    
511     #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
512     #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
513     #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
514    
515     #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);
516     #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);
517     #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);
518    
519     #else
520    
521     #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
522     #local x2_new = x2; #local y2_new = y2; #local z2_new = z2;
523     #end
524    
525     #local myUlen = sqrt(x2_new*x2_new + y2_new*y2_new + z2_new*z2_new);
526     #local uux = x2_new / myUlen;
527     #local uuy = y2_new / myUlen;
528     #local uuz = z2_new / myUlen;
529     #local myTheta = degrees(acos(uuz));
530     #local myPsi = -degrees(atan(uux/uuy));
531     #local myScale = ATOM_SPHERE_FACTOR * 10.000000;
532    
533     sphere{
534     < 0, 0, 0 >, 1
535     texture{
536     pigment{
537     average
538     pigment_map{
539     [1.0 grad1]
540     [1.0 grad2]
541     [1.0 grad3]
542     [5.0 gradz]
543     }
544     }
545     finish{
546     ambient .2
547     diffuse .6
548     specular 1
549     roughness .001
550     metallic
551     }
552     }
553     scale<myScale,myScale,ecc*myScale>
554     rotate<myTheta,0,myPsi>
555     translate< x1_new, y1_new, z1_new>
556     }
557     #end
558     #macro make_GBDP_shaded_ellipse (center_x, center_y, center_z, ecc, u_x, u_y, u_z, v_x, v_y, v_z)
559    
560     #local x1 = center_x;
561     #local y1 = center_y;
562     #local z1 = center_z;
563     #local x2 = u_x;
564     #local y2 = u_y;
565     #local z2 = u_z;
566     #local x3 = v_x;
567     #local y3 = v_y;
568     #local z3 = v_z;
569    
570     #if(ROTATE)
571    
572     #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
573     #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
574     #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
575    
576     #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);
577     #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);
578     #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);
579    
580     #local x3_new = rotatePointX + A11 * (x3-rotatePointX) + A12 * (y3-rotatePointY) + A13 * (z3-rotatePointZ);
581     #local y3_new = rotatePointY + A21 * (x3-rotatePointX) + A22 * (y3-rotatePointY) + A23 * (z3-rotatePointZ);
582     #local z3_new = rotatePointZ + A31 * (x3-rotatePointX) + A32 * (y3-rotatePointY) + A33 * (z3-rotatePointZ);
583    
584     #else
585    
586     #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
587     #local x2_new = x2; #local y2_new = y2; #local z2_new = z2;
588     #local x3_new = x3; #local y3_new = y3; #local z3_new = z3;
589     #end
590    
591     #local myUlen = sqrt(x2_new*x2_new + y2_new*y2_new + z2_new*z2_new);
592     #local uux = x2_new / myUlen;
593     #local uuy = y2_new / myUlen;
594     #local uuz = z2_new / myUlen;
595     #local myVlen = sqrt(x3_new*x3_new + y3_new*y3_new + z3_new*z3_new);
596     #local vvx = x3_new / myVlen;
597     #local vvy = y3_new / myVlen;
598     #local vvz = z3_new / myVlen;
599    
600     #local myTheta = degrees(acos(uuz));
601     #local myPsi = -degrees(atan(uux/uuy));
602     #local myPhi = degrees(acos(vvz));
603     #local myScale = ATOM_SPHERE_FACTOR * 0.13;
604    
605     sphere{
606     < 0, 0, 0 >, 1
607     texture{
608     pigment{
609     function {fn2(x,y,z)}
610     color_map {
611     [0.0 rgb<0.3,0.3,0.3>]
612     [0.33 rgb<0.9,0.9,0.9>]
613     [0.66 rgb<0.3,0.3,1.0>]
614     [1.0 rgb <0.75,0.75,0.3>]
615     }
616     /*
617     average
618     pigment_map{
619     [1.0 grad1]
620     [1.0 grad2]
621     [1.0 grad3]
622     [5.0 gradz]
623     }
624     */
625     }
626     finish{
627     ambient .2
628     diffuse .6
629     specular 1
630     roughness .001
631     metallic
632     }
633     }
634     scale<myScale,myScale,ecc*myScale>
635     rotate<myTheta,myPhi,myPsi>
636     translate< x1_new, y1_new, z1_new>
637     }
638     #end
639     #macro make_GBDP_vector (center_x, center_y, center_z, ux, uy, uz)
640    
641     #local vx = VECTOR_SCALE * ux;
642     #local vy = VECTOR_SCALE * uy;
643     #local vz = VECTOR_SCALE * uz;
644     #local x1 = center_x - 0.5 * vx;
645     #local y1 = center_y - 0.5 * vy;
646     #local z1 = center_z - 0.5 * vz;
647     #local x2 = center_x + 0.5 * vx;
648     #local y2 = center_y + 0.5 * vy;
649     #local z2 = center_z + 0.5 * vz;
650     #local v2 = vx*vx + vy*vy + vz*vz;
651     #local vl = sqrt(v2);
652     #local x3 = x1 + vx * (1.0 - CONE_FRACTION);
653     #local y3 = y1 + vy * (1.0 - CONE_FRACTION);
654     #local z3 = z1 + vz * (1.0 - CONE_FRACTION);
655    
656     #if(ROTATE)
657     #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
658     #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
659     #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
660    
661     #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);
662     #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);
663     #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);
664    
665     #local x3_new = rotatePointX + A11 * (x3-rotatePointX) + A12 * (y3-rotatePointY) + A13 * (z3-rotatePointZ);
666     #local y3_new = rotatePointY + A21 * (x3-rotatePointX) + A22 * (y3-rotatePointY) + A23 * (z3-rotatePointZ);
667     #local z3_new = rotatePointZ + A31 * (x3-rotatePointX) + A32 * (y3-rotatePointY) + A33 * (z3-rotatePointZ);
668    
669     #else
670     #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
671     #local x2_new = x2; #local y2_new = y2; #local z2_new = z2;
672     #local x3_new = x3; #local y3_new = y3; #local z3_new = z3;
673     #end
674    
675     cylinder{
676     < x1_new, y1_new, z1_new >,
677     < x3_new, y3_new, z3_new >,
678     STICK_RADIUS
679     texture{
680     pigment{ rgb < 1.000000, 0.078431, 0.576471 > }
681     finish{
682     ambient .2
683     diffuse .6
684     specular 1
685     roughness .001
686     metallic
687     }
688     }
689     }
690     cone{
691     < x2_new, y2_new, z2_new >, 0.0
692     < x3_new, y3_new, z3_new >, CONE_RADIUS
693     texture{
694     pigment{ rgb < 1.000000, 0.078431, 0.576471 > }
695     finish{
696     ambient .2
697     diffuse .6
698     specular 1
699     roughness .001
700     metallic
701     }
702     }
703     }
704     #end
705    
706