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

File Contents

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