ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/mdRipple/figures/lipidModels/pov_header.pov
Revision: 3185
Committed: Thu Jul 19 21:20:45 2007 UTC (16 years, 11 months ago) by gezelter
File size: 38287 byte(s)
Log Message:
changing figures around

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 = 2048.0;
19 #declare Height = 2048.0;
20 #declare Ratio = Width / Height;
21
22 #declare ATOM_SPHERE_FACTOR = 0.2;
23 #declare BOND_RADIUS = 0.1;
24 #declare VECTOR_SCALE = 1.0;
25 #declare STICK_RADIUS = 0.5 * BOND_RADIUS;
26 #declare CONE_RADIUS = 2.0 * STICK_RADIUS;
27 #declare CONE_FRACTION = 0.15;
28
29 // declare camera, light, and system variables
30
31 #declare sysCenterX = 0.245092;
32 #declare sysCenterY = -0.002897;
33 #declare sysCenterZ = -0.075821;
34
35 #declare zoom = 25.854568;
36
37 #declare cameraLookX = sysCenterX;
38 #declare cameraLookY = sysCenterY;
39 #declare cameraLookZ = sysCenterZ;
40
41 #declare rotatePointX = cameraLookX;
42 #declare rotatePointY = cameraLookY;
43 #declare rotatePointZ = cameraLookZ;
44
45 #declare cameraX = cameraLookX;
46 #declare cameraY = cameraLookY;
47 #declare cameraZ = cameraLookZ - zoom;
48
49 #declare lightAx = cameraX;
50 #declare lightAy = cameraY;
51 #declare lightAz = cameraZ;
52
53 #declare lightBx = cameraX - zoom;
54 #declare lightBy = cameraY + zoom;
55 #declare lightBz = cameraZ;
56
57 #declare boxCenterX = cameraLookX;
58 #declare boxCenterY = cameraLookY;
59 #declare boxCenterZ = cameraLookZ;
60 #declare fn = function(x,y,z) {(y+1)/2}
61 #declare grad1 = pigment { function { fn(x, y, z) } color_map {[0.0 rgb <0,0,0>] [1.0 rgb <3,0,0>]} };
62 #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>]} };
63 #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>]} };
64 #declare fnz = function(x,y,z) {(z+1)/2}
65 #declare gradz = pigment { function { fnz(x, y, z) } color_map {[0.0 rgb <0,0,0>] [1.0 rgb <1,1,1>]} };
66 #declare fn2 = function(x,y,z) {
67 (z > 0.01) * 0.66 +
68 (z < -0.01 ) * 1.0
69 }
70
71 // declare the cameras and the light sources
72
73 camera{
74 location < cameraX, cameraY, cameraZ>
75 right < Ratio , 0, 0>
76 look_at < cameraLookX, cameraLookY, cameraLookZ >
77 }
78
79 light_source{
80 < lightAx, lightAy, lightAz >
81 rgb < 1.0, 1.0, 1.0 > }
82
83 light_source{
84 < lightBx, lightBy, lightBz >
85 rgb < 1.0, 1.0, 1.0 > }
86
87
88 //************************************************************
89 // Set whether or not to rotate the system.
90 //
91 // To Rotate, set ROTATE to 1.0 (true),
92 // Then set the Euler Angles PHI, THETA, and PSI in degrees.
93 //************************************************************
94
95 #declare ROTATE = 0.0;
96 #declare PHI = 0.0;
97 #declare THETA = 0.0;
98 #declare PSI = 0.0;
99
100 #if(ROTATE)
101 #declare phi_r = radians(PHI);
102 #declare theta_r = radians(THETA);
103 #declare psi_r = radians(PSI);
104
105 #declare A11 = cos(phi_r) * cos(psi_r) - sin(phi_r) * cos(theta_r) * sin(psi_r);
106 #declare A12 = sin(phi_r) * cos(psi_r) + cos(phi_r) * cos(theta_r) * sin(psi_r);
107 #declare A13 = sin(theta_r) * sin(psi_r);
108
109 #declare A21 = -cos(phi_r) * sin(psi_r) - sin(phi_r) * cos(theta_r) * cos(psi_r);
110 #declare A22 = -sin(phi_r) * sin(psi_r) + cos(phi_r) * cos(theta_r) * cos(psi_r);
111 #declare A23 = sin(theta_r) * cos(psi_r);
112
113 #declare A31 = sin(phi_r) * sin(theta_r);
114 #declare A32 = -cos(phi_r) * sin(theta_r);
115 #declare A33 = cos(theta_r);
116
117 #end
118
119
120 //************************************************************
121 // declare the periodic box macro
122 //************************************************************
123
124 #macro makePeriodicBox( bx1, by1, bz1, bx2, by2, bz2, bx3, by3, bz3 )
125
126 #local bcx = (bx1 + bx2 + bx3) / 2.0;
127 #local bcy = (by1 + by2 + by3) / 2.0;
128 #local bcz = (bz1 + bz2 + bz3) / 2.0;
129
130 #local pAx = boxCenterX - bcx;
131 #local pAy = boxCenterY - bcy;
132 #local pAz = boxCenterZ - bcz;
133 #local pBx = boxCenterX + bx1 - bcx;
134 #local pBy = boxCenterY + by1 - bcy;
135 #local pBz = boxCenterZ + bz1 - bcz;
136 #local pCx = boxCenterX + bx2 - bcx;
137 #local pCy = boxCenterY + by2 - bcy;
138 #local pCz = boxCenterZ + bz2 - bcz;
139 #local pDx = boxCenterX + bx3 - bcx;
140 #local pDy = boxCenterY + by3 - bcy;
141 #local pDz = boxCenterZ + bz3 - bcz;
142 #local pEx = boxCenterX + bx1 + bx2 - bcx;
143 #local pEy = boxCenterY + by1 + by2 - bcy;
144 #local pEz = boxCenterZ + bz1 + bz2 - bcz;
145 #local pFx = boxCenterX + bx1 + bx3 - bcx;
146 #local pFy = boxCenterY + by1 + by3 - bcy;
147 #local pFz = boxCenterZ + bz1 + bz3 - bcz;
148 #local pGx = boxCenterX + bx2 + bx3 - bcx;
149 #local pGy = boxCenterY + by2 + by3 - bcy;
150 #local pGz = boxCenterZ + bz2 + bz3 - bcz;
151 #local pHx = boxCenterX + bx1 + bx2 + bx3 - bcx;
152 #local pHy = boxCenterY + by1 + by2 + by3 - bcy;
153 #local pHz = boxCenterZ + bz1 + bz2 + bz3 - bcz;
154
155 #if(ROTATE)
156 #local pAx_new = rotatePointX + A11 * (pAx-rotatePointX) + A12 * (pAy-rotatePointY) + A13 * (pAz-rotatePointZ);
157 #local pAy_new = rotatePointY + A21 * (pAx-rotatePointX) + A22 * (pAy-rotatePointY) + A23 * (pAz-rotatePointZ);
158 #local pAz_new = rotatePointZ + A31 * (pAx-rotatePointX) + A32 * (pAy-rotatePointY) + A33 * (pAz-rotatePointZ);
159
160 #local pBx_new = rotatePointX + A11 * (pBx-rotatePointX) + A12 * (pBy-rotatePointY) + A13 * (pBz-rotatePointZ);
161 #local pBy_new = rotatePointY + A21 * (pBx-rotatePointX) + A22 * (pBy-rotatePointY) + A23 * (pBz-rotatePointZ);
162 #local pBz_new = rotatePointZ + A31 * (pBx-rotatePointX) + A32 * (pBy-rotatePointY) + A33 * (pBz-rotatePointZ);
163
164 #local pCx_new = rotatePointX + A11 * (pCx-rotatePointX) + A12 * (pCy-rotatePointY) + A13 * (pCz-rotatePointZ);
165 #local pCy_new = rotatePointY + A21 * (pCx-rotatePointX) + A22 * (pCy-rotatePointY) + A23 * (pCz-rotatePointZ);
166 #local pCz_new = rotatePointZ + A31 * (pCx-rotatePointX) + A32 * (pCy-rotatePointY) + A33 * (pCz-rotatePointZ);
167
168 #local pDx_new = rotatePointX + A11 * (pDx-rotatePointX) + A12 * (pDy-rotatePointY) + A13 * (pDz-rotatePointZ);
169 #local pDy_new = rotatePointY + A21 * (pDx-rotatePointX) + A22 * (pDy-rotatePointY) + A23 * (pDz-rotatePointZ);
170 #local pDz_new = rotatePointZ + A31 * (pDx-rotatePointX) + A32 * (pDy-rotatePointY) + A33 * (pDz-rotatePointZ);
171
172 #local pEx_new = rotatePointX + A11 * (pEx-rotatePointX) + A12 * (pEy-rotatePointY) + A13 * (pEz-rotatePointZ);
173 #local pEy_new = rotatePointY + A21 * (pEx-rotatePointX) + A22 * (pEy-rotatePointY) + A23 * (pEz-rotatePointZ);
174 #local pEz_new = rotatePointZ + A31 * (pEx-rotatePointX) + A32 * (pEy-rotatePointY) + A33 * (pEz-rotatePointZ);
175
176 #local pFx_new = rotatePointX + A11 * (pFx-rotatePointX) + A12 * (pFy-rotatePointY) + A13 * (pFz-rotatePointZ);
177 #local pFy_new = rotatePointY + A21 * (pFx-rotatePointX) + A22 * (pFy-rotatePointY) + A23 * (pFz-rotatePointZ);
178 #local pFz_new = rotatePointZ + A31 * (pFx-rotatePointX) + A32 * (pFy-rotatePointY) + A33 * (pFz-rotatePointZ);
179
180 #local pGx_new = rotatePointX + A11 * (pGx-rotatePointX) + A12 * (pGy-rotatePointY) + A13 * (pGz-rotatePointZ);
181 #local pGy_new = rotatePointY + A21 * (pGx-rotatePointX) + A22 * (pGy-rotatePointY) + A23 * (pGz-rotatePointZ);
182 #local pGz_new = rotatePointZ + A31 * (pGx-rotatePointX) + A32 * (pGy-rotatePointY) + A33 * (pGz-rotatePointZ);
183
184 #local pHx_new = rotatePointX + A11 * (pHx-rotatePointX) + A12 * (pHy-rotatePointY) + A13 * (pHz-rotatePointZ);
185 #local pHy_new = rotatePointY + A21 * (pHx-rotatePointX) + A22 * (pHy-rotatePointY) + A23 * (pHz-rotatePointZ);
186 #local pHz_new = rotatePointZ + A31 * (pHx-rotatePointX) + A32 * (pHy-rotatePointY) + A33 * (pHz-rotatePointZ);
187
188 #else
189 #local pAx_new = pAx; #local pAy_new = pAy; #local pAz_new = pAz;
190 #local pBx_new = pBx; #local pBy_new = pBy; #local pBz_new = pBz;
191 #local pCx_new = pCx; #local pCy_new = pCy; #local pCz_new = pCz;
192 #local pDx_new = pDx; #local pDy_new = pDy; #local pDz_new = pDz;
193 #local pEx_new = pEx; #local pEy_new = pEy; #local pEz_new = pEz;
194 #local pFx_new = pFx; #local pFy_new = pFy; #local pFz_new = pFz;
195 #local pGx_new = pGx; #local pGy_new = pGy; #local pGz_new = pGz;
196 #local pHx_new = pHx; #local pHy_new = pHy; #local pHz_new = pHz;
197 #end
198 #local pAx = pAx_new; #local pAy = pAy_new; #local pAz = pAz_new;
199 #local pBx = pBx_new; #local pBy = pBy_new; #local pBz = pBz_new;
200 #local pCx = pCx_new; #local pCy = pCy_new; #local pCz = pCz_new;
201 #local pDx = pDx_new; #local pDy = pDy_new; #local pDz = pDz_new;
202 #local pEx = pEx_new; #local pEy = pEy_new; #local pEz = pEz_new;
203 #local pFx = pFx_new; #local pFy = pFy_new; #local pFz = pFz_new;
204 #local pGx = pGx_new; #local pGy = pGy_new; #local pGz = pGz_new;
205 #local pHx = pHx_new; #local pHy = pHy_new; #local pHz = pHz_new;
206 #local colorR = 0.90;
207 #local colorG = 0.91;
208 #local colorB = 0.98;
209
210 #local pipeWidth = 0.4;
211
212 // 1
213 cylinder{
214 < pAx, pAy, pAz >,
215 < pBx, pBy, pBz >,
216 pipeWidth
217 texture{
218 pigment{ rgb < colorR, colorG, colorB > }
219 finish{
220 ambient .2
221 diffuse .6
222 specular 1
223 roughness .001
224 metallic
225 }
226 }
227 }
228
229 // 2
230 cylinder{
231 < pAx, pAy, pAz >,
232 < pCx, pCy, pCz >,
233 pipeWidth
234 texture{
235 pigment{ rgb < colorR, colorG, colorB > }
236 finish{
237 ambient .2
238 diffuse .6
239 specular 1
240 roughness .001
241 metallic
242 }
243 }
244 }
245
246 // 3
247 cylinder{
248 < pAx, pAy, pAz >,
249 < pDx, pDy, pDz >,
250 pipeWidth
251 texture{
252 pigment{ rgb < colorR, colorG, colorB > }
253 finish{
254 ambient .2
255 diffuse .6
256 specular 1
257 roughness .001
258 metallic
259 }
260 }
261 }
262
263 // 4
264 cylinder{
265 < pBx, pBy, pBz >,
266 < pEx, pEy, pEz >,
267 pipeWidth
268 texture{
269 pigment{ rgb < colorR, colorG, colorB > }
270 finish{
271 ambient .2
272 diffuse .6
273 specular 1
274 roughness .001
275 metallic
276 }
277 }
278 }
279
280 // 5
281 cylinder{
282 < pCx, pCy, pCz >,
283 < pEx, pEy, pEz >,
284 pipeWidth
285 texture{
286 pigment{ rgb < colorR, colorG, colorB > }
287 finish{
288 ambient .2
289 diffuse .6
290 specular 1
291 roughness .001
292 metallic
293 }
294 }
295 }
296
297 // 6
298 cylinder{
299 < pBx, pBy, pBz >,
300 < pFx, pFy, pFz >,
301 pipeWidth
302 texture{
303 pigment{ rgb < colorR, colorG, colorB > }
304 finish{
305 ambient .2
306 diffuse .6
307 specular 1
308 roughness .001
309 metallic
310 }
311 }
312 }
313
314 // 7
315 cylinder{
316 < pCx, pCy, pCz >,
317 < pGx, pGy, pGz >,
318 pipeWidth
319 texture{
320 pigment{ rgb < colorR, colorG, colorB > }
321 finish{
322 ambient .2
323 diffuse .6
324 specular 1
325 roughness .001
326 metallic
327 }
328 }
329 }
330
331 // 8
332 cylinder{
333 < pDx, pDy, pDz >,
334 < pGx, pGy, pGz >,
335 pipeWidth
336 texture{
337 pigment{ rgb < colorR, colorG, colorB > }
338 finish{
339 ambient .2
340 diffuse .6
341 specular 1
342 roughness .001
343 metallic
344 }
345 }
346 }
347
348 // 9
349 cylinder{
350 < pDx, pDy, pDz >,
351 < pFx, pFy, pFz >,
352 pipeWidth
353 texture{
354 pigment{ rgb < colorR, colorG, colorB > }
355 finish{
356 ambient .2
357 diffuse .6
358 specular 1
359 roughness .001
360 metallic
361 }
362 }
363 }
364
365 // 10
366 cylinder{
367 < pEx, pEy, pEz >,
368 < pHx, pHy, pHz >,
369 pipeWidth
370 texture{
371 pigment{ rgb < colorR, colorG, colorB > }
372 finish{
373 ambient .2
374 diffuse .6
375 specular 1
376 roughness .001
377 metallic
378 }
379 }
380 }
381
382 // 11
383 cylinder{
384 < pFx, pFy, pFz >,
385 < pHx, pHy, pHz >,
386 pipeWidth
387 texture{
388 pigment{ rgb < colorR, colorG, colorB > }
389 finish{
390 ambient .2
391 diffuse .6
392 specular 1
393 roughness .001
394 metallic
395 }
396 }
397 }
398
399 // 12
400 cylinder{
401 < pGx, pGy, pGz >,
402 < pHx, pHy, pHz >,
403 pipeWidth
404 texture{
405 pigment{ rgb < colorR, colorG, colorB > }
406 finish{
407 ambient .2
408 diffuse .6
409 specular 1
410 roughness .001
411 metallic
412 }
413 }
414 }
415
416 #end
417
418
419 //****************************************************
420 // DEFINE DPD MACROS
421 //****************************************************
422
423 #macro make_DPD_bond (end_1x, end_1y, end_1z, end_2x, end_2y, end_2z)
424
425 #local x1 = end_1x;
426 #local y1 = end_1y;
427 #local z1 = end_1z;
428 #local x2 = end_2x;
429 #local y2 = end_2y;
430 #local z2 = end_2z;
431
432 #if(ROTATE)
433 #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
434 #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
435 #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
436
437 #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);
438 #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);
439 #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);
440
441 #else
442 #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
443 #local x2_new = x2; #local y2_new = y2; #local z2_new = z2;
444 #end
445
446 cylinder{
447 < x1_new, y1_new, z1_new >,
448 < x2_new, y2_new, z2_new >,
449 BOND_RADIUS
450 texture{
451 pigment{ rgb < 0.439216, 0.501961, 0.564706 > }
452 finish{
453 ambient .2
454 diffuse .6
455 specular 1
456 roughness .001
457 metallic
458 }
459 }
460 }
461 #end
462 #macro make_DPD_atom (center_x, center_y, center_z)
463
464 #local x1 = center_x;
465 #local y1 = center_y;
466 #local z1 = center_z;
467
468 #if(ROTATE)
469
470 #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
471 #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
472 #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
473
474 #else
475
476 #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
477 #end
478
479 sphere{
480 < x1_new, y1_new, z1_new >,
481 ATOM_SPHERE_FACTOR * 3.000000
482 texture{
483 pigment{ rgb < 0.439216, 0.501961, 0.564706 > }
484 finish{
485 ambient .2
486 diffuse .6
487 specular 1
488 roughness .001
489 metallic
490 }
491 }
492 }
493 #end
494 #macro make_DPD_ellipse (center_x, center_y, center_z, ecc, u_x, u_y, u_z)
495
496 #local x1 = center_x;
497 #local y1 = center_y;
498 #local z1 = center_z;
499 #local x2 = u_x;
500 #local y2 = u_y;
501 #local z2 = u_z;
502
503 #if(ROTATE)
504
505 #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
506 #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
507 #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
508
509 #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);
510 #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);
511 #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);
512
513 #else
514
515 #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
516 #local x2_new = x2; #local y2_new = y2; #local z2_new = z2;
517 #end
518
519 #local myUlen = sqrt(x2_new*x2_new + y2_new*y2_new + z2_new*z2_new);
520 #local uux = x2_new / myUlen;
521 #local uuy = y2_new / myUlen;
522 #local uuz = z2_new / myUlen;
523 #local myTheta = degrees(acos(uuz));
524 #local myPsi = -degrees(atan(uux/uuy));
525 #local myScale = ATOM_SPHERE_FACTOR * 3.000000;
526
527 sphere{
528 < 0, 0, 0 >, 1
529 texture{
530 pigment{
531 average
532 pigment_map{
533 [1.0 grad1]
534 [1.0 grad2]
535 [1.0 grad3]
536 [5.0 gradz]
537 }
538 }
539 finish{
540 ambient .2
541 diffuse .6
542 specular 1
543 roughness .001
544 metallic
545 }
546 }
547 scale<myScale,myScale,ecc*myScale>
548 rotate<myTheta,0,myPsi>
549 translate< x1_new, y1_new, z1_new>
550 }
551 #end
552 #macro make_DPD_shaded_ellipse (center_x, center_y, center_z, ecc, u_x, u_y, u_z, v_x, v_y, v_z)
553
554 #local x1 = center_x;
555 #local y1 = center_y;
556 #local z1 = center_z;
557 #local x2 = u_x;
558 #local y2 = u_y;
559 #local z2 = u_z;
560 #local x3 = v_x;
561 #local y3 = v_y;
562 #local z3 = v_z;
563
564 #if(ROTATE)
565
566 #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
567 #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
568 #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
569
570 #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);
571 #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);
572 #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);
573
574 #local x3_new = rotatePointX + A11 * (x3-rotatePointX) + A12 * (y3-rotatePointY) + A13 * (z3-rotatePointZ);
575 #local y3_new = rotatePointY + A21 * (x3-rotatePointX) + A22 * (y3-rotatePointY) + A23 * (z3-rotatePointZ);
576 #local z3_new = rotatePointZ + A31 * (x3-rotatePointX) + A32 * (y3-rotatePointY) + A33 * (z3-rotatePointZ);
577
578 #else
579
580 #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
581 #local x2_new = x2; #local y2_new = y2; #local z2_new = z2;
582 #local x3_new = x3; #local y3_new = y3; #local z3_new = z3;
583 #end
584
585 #local myUlen = sqrt(x2_new*x2_new + y2_new*y2_new + z2_new*z2_new);
586 #local uux = x2_new / myUlen;
587 #local uuy = y2_new / myUlen;
588 #local uuz = z2_new / myUlen;
589 #local myVlen = sqrt(x3_new*x3_new + y3_new*y3_new + z3_new*z3_new);
590 #local vvx = x3_new / myVlen;
591 #local vvy = y3_new / myVlen;
592 #local vvz = z3_new / myVlen;
593
594 #local myTheta = degrees(acos(uuz));
595 #local myPsi = -degrees(atan(uux/uuy));
596 #local myPhi = degrees(acos(vvz));
597 #local myScale = ATOM_SPHERE_FACTOR * 3.000000;
598
599 sphere{
600 < 0, 0, 0 >, 1
601 texture{
602 pigment{
603 average
604 pigment_map{
605 [1.0 grad1]
606 [1.0 grad2]
607 [1.0 grad3]
608 [5.0 gradz]
609 }
610 }
611 finish{
612 ambient .2
613 diffuse .6
614 specular 1
615 roughness .001
616 metallic
617 }
618 }
619 scale<myScale,myScale,ecc*myScale>
620 rotate<myTheta,myPhi,myPsi>
621 translate< x1_new, y1_new, z1_new>
622 }
623 #end
624 #macro make_DPD_vector (center_x, center_y, center_z, ux, uy, uz)
625
626 #local vx = VECTOR_SCALE * ux;
627 #local vy = VECTOR_SCALE * uy;
628 #local vz = VECTOR_SCALE * uz;
629 #local x1 = center_x - 0.5 * vx;
630 #local y1 = center_y - 0.5 * vy;
631 #local z1 = center_z - 0.5 * vz;
632 #local x2 = center_x + 0.5 * vx;
633 #local y2 = center_y + 0.5 * vy;
634 #local z2 = center_z + 0.5 * vz;
635 #local v2 = vx*vx + vy*vy + vz*vz;
636 #local vl = sqrt(v2);
637 #local x3 = x1 + vx * (1.0 - CONE_FRACTION);
638 #local y3 = y1 + vy * (1.0 - CONE_FRACTION);
639 #local z3 = z1 + vz * (1.0 - CONE_FRACTION);
640
641 #if(ROTATE)
642 #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
643 #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
644 #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
645
646 #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);
647 #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);
648 #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);
649
650 #local x3_new = rotatePointX + A11 * (x3-rotatePointX) + A12 * (y3-rotatePointY) + A13 * (z3-rotatePointZ);
651 #local y3_new = rotatePointY + A21 * (x3-rotatePointX) + A22 * (y3-rotatePointY) + A23 * (z3-rotatePointZ);
652 #local z3_new = rotatePointZ + A31 * (x3-rotatePointX) + A32 * (y3-rotatePointY) + A33 * (z3-rotatePointZ);
653
654 #else
655 #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
656 #local x2_new = x2; #local y2_new = y2; #local z2_new = z2;
657 #local x3_new = x3; #local y3_new = y3; #local z3_new = z3;
658 #end
659
660 cylinder{
661 < x1_new, y1_new, z1_new >,
662 < x3_new, y3_new, z3_new >,
663 STICK_RADIUS
664 texture{
665 pigment{ rgb < 0.439216, 0.501961, 0.564706 > }
666 finish{
667 ambient .2
668 diffuse .6
669 specular 1
670 roughness .001
671 metallic
672 }
673 }
674 }
675 cone{
676 < x2_new, y2_new, z2_new >, 0.0
677 < x3_new, y3_new, z3_new >, CONE_RADIUS
678 texture{
679 pigment{ rgb < 0.439216, 0.501961, 0.564706 > }
680 finish{
681 ambient .2
682 diffuse .6
683 specular 1
684 roughness .001
685 metallic
686 }
687 }
688 }
689 #end
690
691
692 //****************************************************
693 // DEFINE GB MACROS
694 //****************************************************
695
696 #macro make_GB_bond (end_1x, end_1y, end_1z, end_2x, end_2y, end_2z)
697
698 #local x1 = end_1x;
699 #local y1 = end_1y;
700 #local z1 = end_1z;
701 #local x2 = end_2x;
702 #local y2 = end_2y;
703 #local z2 = end_2z;
704
705 #if(ROTATE)
706 #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
707 #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
708 #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
709
710 #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);
711 #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);
712 #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);
713
714 #else
715 #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
716 #local x2_new = x2; #local y2_new = y2; #local z2_new = z2;
717 #end
718
719 cylinder{
720 < x1_new, y1_new, z1_new >,
721 < x2_new, y2_new, z2_new >,
722 BOND_RADIUS
723 texture{
724 pigment{ rgb < 1.000000, 0.078431, 0.576471 > }
725 finish{
726 ambient .2
727 diffuse .6
728 specular 1
729 roughness .001
730 metallic
731 }
732 }
733 }
734 #end
735 #macro make_GB_atom (center_x, center_y, center_z)
736
737 #local x1 = center_x;
738 #local y1 = center_y;
739 #local z1 = center_z;
740
741 #if(ROTATE)
742
743 #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
744 #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
745 #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
746
747 #else
748
749 #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
750 #end
751
752 sphere{
753 < x1_new, y1_new, z1_new >,
754 ATOM_SPHERE_FACTOR * 1.000000
755 texture{
756 pigment{ rgb < 1.000000, 0.078431, 0.576471 > }
757 finish{
758 ambient .2
759 diffuse .6
760 specular 1
761 roughness .001
762 metallic
763 }
764 }
765 }
766 #end
767 #macro make_GB_ellipse (center_x, center_y, center_z, ecc, u_x, u_y, u_z)
768
769 #local x1 = center_x;
770 #local y1 = center_y;
771 #local z1 = center_z;
772 #local x2 = u_x;
773 #local y2 = u_y;
774 #local z2 = u_z;
775
776 #if(ROTATE)
777
778 #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
779 #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
780 #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
781
782 #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);
783 #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);
784 #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);
785
786 #else
787
788 #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
789 #local x2_new = x2; #local y2_new = y2; #local z2_new = z2;
790 #end
791
792 #local myUlen = sqrt(x2_new*x2_new + y2_new*y2_new + z2_new*z2_new);
793 #local uux = x2_new / myUlen;
794 #local uuy = y2_new / myUlen;
795 #local uuz = z2_new / myUlen;
796 #local myTheta = degrees(acos(uuz));
797 #local myPsi = -degrees(atan(uux/uuy));
798 #local myScale = ATOM_SPHERE_FACTOR * 15.000000;
799
800 sphere{
801 < 0, 0, 0 >, 1
802 texture{
803 pigment{
804 average
805 pigment_map{
806 [1.0 grad1]
807 [1.0 grad2]
808 [1.0 grad3]
809 [5.0 gradz]
810 }
811 }
812 finish{
813 ambient .2
814 diffuse .6
815 specular 1
816 roughness .001
817 metallic
818 }
819 }
820 scale<myScale,myScale,ecc*myScale>
821 rotate<myTheta,0,myPsi>
822 translate< x1_new, y1_new, z1_new>
823 }
824 #end
825 #macro make_GB_shaded_ellipse (center_x, center_y, center_z, ecc, u_x, u_y, u_z)
826
827 #local x1 = center_x;
828 #local y1 = center_y;
829 #local z1 = center_z;
830 #local x2 = u_x;
831 #local y2 = u_y;
832 #local z2 = u_z;
833
834 #if(ROTATE)
835
836 #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
837 #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
838 #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
839
840 #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);
841 #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);
842 #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);
843
844 #else
845
846 #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
847 #local x2_new = x2; #local y2_new = y2; #local z2_new = z2;
848 #end
849
850 #local myUlen = sqrt(x2_new*x2_new + y2_new*y2_new + z2_new*z2_new);
851 #local uux = x2_new / myUlen;
852 #local uuy = y2_new / myUlen;
853 #local uuz = z2_new / myUlen;
854
855 #local myTheta = degrees(acos(uuz));
856 #local myPsi = -degrees(atan(uux/uuy));
857 #local myScale = ATOM_SPHERE_FACTOR * 1.000000;
858
859 sphere{
860 < 0, 0, 0 >, 1
861 texture{
862 pigment{
863 average
864 pigment_map{
865 [1.0 grad1]
866 [1.0 grad2]
867 [1.0 grad3]
868 [5.0 gradz]
869 }
870 }
871 finish{
872 ambient .2
873 diffuse .6
874 specular 1
875 roughness .001
876 metallic
877 }
878 }
879 scale<myScale,myScale,ecc*myScale>
880 rotate<myTheta,0,myPsi>
881 translate< x1_new, y1_new, z1_new>
882 }
883 #end
884 #macro make_GB_vector (center_x, center_y, center_z, ux, uy, uz)
885
886 #local vx = VECTOR_SCALE * ux;
887 #local vy = VECTOR_SCALE * uy;
888 #local vz = VECTOR_SCALE * uz;
889 #local x1 = center_x - 0.5 * vx;
890 #local y1 = center_y - 0.5 * vy;
891 #local z1 = center_z - 0.5 * vz;
892 #local x2 = center_x + 0.5 * vx;
893 #local y2 = center_y + 0.5 * vy;
894 #local z2 = center_z + 0.5 * vz;
895 #local v2 = vx*vx + vy*vy + vz*vz;
896 #local vl = sqrt(v2);
897 #local x3 = x1 + vx * (1.0 - CONE_FRACTION);
898 #local y3 = y1 + vy * (1.0 - CONE_FRACTION);
899 #local z3 = z1 + vz * (1.0 - CONE_FRACTION);
900
901 #if(ROTATE)
902 #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
903 #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
904 #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
905
906 #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);
907 #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);
908 #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);
909
910 #local x3_new = rotatePointX + A11 * (x3-rotatePointX) + A12 * (y3-rotatePointY) + A13 * (z3-rotatePointZ);
911 #local y3_new = rotatePointY + A21 * (x3-rotatePointX) + A22 * (y3-rotatePointY) + A23 * (z3-rotatePointZ);
912 #local z3_new = rotatePointZ + A31 * (x3-rotatePointX) + A32 * (y3-rotatePointY) + A33 * (z3-rotatePointZ);
913
914 #else
915 #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
916 #local x2_new = x2; #local y2_new = y2; #local z2_new = z2;
917 #local x3_new = x3; #local y3_new = y3; #local z3_new = z3;
918 #end
919
920 cylinder{
921 < x1_new, y1_new, z1_new >,
922 < x3_new, y3_new, z3_new >,
923 STICK_RADIUS
924 texture{
925 pigment{ rgb < 1.000000, 0.078431, 0.576471 > }
926 finish{
927 ambient .2
928 diffuse .6
929 specular 1
930 roughness .001
931 metallic
932 }
933 }
934 }
935 cone{
936 < x2_new, y2_new, z2_new >, 0.0
937 < x3_new, y3_new, z3_new >, CONE_RADIUS
938 texture{
939 pigment{ rgb < 1.000000, 0.078431, 0.576471 > }
940 finish{
941 ambient .2
942 diffuse .6
943 specular 1
944 roughness .001
945 metallic
946 }
947 }
948 }
949 #end
950
951
952 //****************************************************
953 // DEFINE GBlh MACROS
954 //****************************************************
955
956 #macro make_GBlh_bond (end_1x, end_1y, end_1z, end_2x, end_2y, end_2z)
957
958 #local x1 = end_1x;
959 #local y1 = end_1y;
960 #local z1 = end_1z;
961 #local x2 = end_2x;
962 #local y2 = end_2y;
963 #local z2 = end_2z;
964
965 #if(ROTATE)
966 #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
967 #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
968 #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
969
970 #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);
971 #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);
972 #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);
973
974 #else
975 #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
976 #local x2_new = x2; #local y2_new = y2; #local z2_new = z2;
977 #end
978
979 cylinder{
980 < x1_new, y1_new, z1_new >,
981 < x2_new, y2_new, z2_new >,
982 BOND_RADIUS
983 texture{
984 pigment{ rgb < 1.000000, 0.078431, 0.576471 > }
985 finish{
986 ambient .2
987 diffuse .6
988 specular 1
989 roughness .001
990 metallic
991 }
992 }
993 }
994 #end
995 #macro make_GBlh_atom (center_x, center_y, center_z)
996
997 #local x1 = center_x;
998 #local y1 = center_y;
999 #local z1 = center_z;
1000
1001 #if(ROTATE)
1002
1003 #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
1004 #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
1005 #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
1006
1007 #else
1008
1009 #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
1010 #end
1011
1012 sphere{
1013 < x1_new, y1_new, z1_new >,
1014 ATOM_SPHERE_FACTOR * 10.000000
1015 texture{
1016 pigment{ rgb < 1.000000, 0.078431, 0.576471 > }
1017 finish{
1018 ambient .2
1019 diffuse .6
1020 specular 1
1021 roughness .001
1022 metallic
1023 }
1024 }
1025 }
1026 #end
1027 #macro make_GBlh_ellipse (center_x, center_y, center_z, ecc, u_x, u_y, u_z)
1028
1029 #local x1 = center_x;
1030 #local y1 = center_y;
1031 #local z1 = center_z;
1032 #local x2 = u_x;
1033 #local y2 = u_y;
1034 #local z2 = u_z;
1035
1036 #if(ROTATE)
1037
1038 #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
1039 #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
1040 #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
1041
1042 #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);
1043 #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);
1044 #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);
1045
1046 #else
1047
1048 #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
1049 #local x2_new = x2; #local y2_new = y2; #local z2_new = z2;
1050 #end
1051
1052 #local myUlen = sqrt(x2_new*x2_new + y2_new*y2_new + z2_new*z2_new);
1053 #local uux = x2_new / myUlen;
1054 #local uuy = y2_new / myUlen;
1055 #local uuz = z2_new / myUlen;
1056 #local myTheta = degrees(acos(uuz));
1057 #local myPsi = -degrees(atan(uux/uuy));
1058 #local myScale = ATOM_SPHERE_FACTOR * 10.000000;
1059
1060 sphere{
1061 < 0, 0, 0 >, 1
1062 texture{
1063 pigment{
1064 average
1065 pigment_map{
1066 [1.0 grad1]
1067 [1.0 grad2]
1068 [1.0 grad3]
1069 [5.0 gradz]
1070 }
1071 }
1072 finish{
1073 ambient .2
1074 diffuse .6
1075 specular 1
1076 roughness .001
1077 metallic
1078 }
1079 }
1080 scale<myScale,myScale,ecc*myScale>
1081 rotate<myTheta,0,myPsi>
1082 translate< x1_new, y1_new, z1_new>
1083 }
1084 #end
1085 #macro make_GBlh_shaded_ellipse (center_x, center_y, center_z, ecc, u_x, u_y, u_z)
1086
1087 #local x1 = center_x;
1088 #local y1 = center_y;
1089 #local z1 = center_z;
1090 #local x2 = u_x;
1091 #local y2 = u_y;
1092 #local z2 = u_z;
1093
1094 #if(ROTATE)
1095
1096 #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
1097 #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
1098 #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
1099
1100 #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);
1101 #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);
1102 #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);
1103
1104 #else
1105
1106 #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
1107 #local x2_new = x2; #local y2_new = y2; #local z2_new = z2;
1108 #end
1109
1110 #local myUlen = sqrt(x2_new*x2_new + y2_new*y2_new + z2_new*z2_new);
1111 #local uux = x2_new / myUlen;
1112 #local uuy = y2_new / myUlen;
1113 #local uuz = z2_new / myUlen;
1114
1115 #local myTheta = degrees(acos(uuz));
1116 #local myPsi = -degrees(atan(uux/uuy));
1117 #local myScale = ATOM_SPHERE_FACTOR * 19.2000000;
1118
1119 sphere{
1120 < 0, 0, 0 >, 1
1121 texture{
1122 pigment{
1123 /*
1124 function {fnz(x,y,z)}
1125 color_map {
1126 [0.0 rgb<0.3,0.3,1.0> ]
1127 [1.0 rgb<0.75,0.75,0.3> ]
1128 }
1129 */
1130 function {fn2(x,y,z)}
1131 color_map {
1132 [0.0 rgb<0.3,0.3,0.3>]
1133 [0.66 rgb<0.3,0.3,1.0>]
1134 [1.0 rgb <0.75,0.75,0.3>]
1135 }
1136 /* average
1137 pigment_map{
1138 [1.0 grad1]
1139 [1.0 grad2]
1140 [1.0 grad3]
1141 [5.0 gradz]
1142 }
1143 */
1144 }
1145 finish{
1146 ambient .2
1147 diffuse .6
1148 specular 1
1149 roughness .001
1150 metallic
1151 }
1152 }
1153 scale<myScale,myScale,ecc*myScale>
1154 rotate<myTheta,0,myPsi>
1155 translate< x1_new, y1_new, z1_new>
1156 }
1157 #end
1158 #macro make_GBlh_vector (center_x, center_y, center_z, ux, uy, uz)
1159
1160 #local vx = VECTOR_SCALE * ux;
1161 #local vy = VECTOR_SCALE * uy;
1162 #local vz = VECTOR_SCALE * uz;
1163 #local x1 = center_x - 0.5 * vx;
1164 #local y1 = center_y - 0.5 * vy;
1165 #local z1 = center_z - 0.5 * vz;
1166 #local x2 = center_x + 0.5 * vx;
1167 #local y2 = center_y + 0.5 * vy;
1168 #local z2 = center_z + 0.5 * vz;
1169 #local v2 = vx*vx + vy*vy + vz*vz;
1170 #local vl = sqrt(v2);
1171 #local x3 = x1 + vx * (1.0 - CONE_FRACTION);
1172 #local y3 = y1 + vy * (1.0 - CONE_FRACTION);
1173 #local z3 = z1 + vz * (1.0 - CONE_FRACTION);
1174
1175 #if(ROTATE)
1176 #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);
1177 #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);
1178 #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);
1179
1180 #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);
1181 #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);
1182 #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);
1183
1184 #local x3_new = rotatePointX + A11 * (x3-rotatePointX) + A12 * (y3-rotatePointY) + A13 * (z3-rotatePointZ);
1185 #local y3_new = rotatePointY + A21 * (x3-rotatePointX) + A22 * (y3-rotatePointY) + A23 * (z3-rotatePointZ);
1186 #local z3_new = rotatePointZ + A31 * (x3-rotatePointX) + A32 * (y3-rotatePointY) + A33 * (z3-rotatePointZ);
1187
1188 #else
1189 #local x1_new = x1; #local y1_new = y1; #local z1_new = z1;
1190 #local x2_new = x2; #local y2_new = y2; #local z2_new = z2;
1191 #local x3_new = x3; #local y3_new = y3; #local z3_new = z3;
1192 #end
1193
1194 cylinder{
1195 < x1_new, y1_new, z1_new >,
1196 < x3_new, y3_new, z3_new >,
1197 STICK_RADIUS
1198 texture{
1199 pigment{ rgb < 1.000000, 0.078431, 0.576471 > }
1200 finish{
1201 ambient .2
1202 diffuse .6
1203 specular 1
1204 roughness .001
1205 metallic
1206 }
1207 }
1208 }
1209 cone{
1210 < x2_new, y2_new, z2_new >, 0.0
1211 < x3_new, y3_new, z3_new >, CONE_RADIUS
1212 texture{
1213 pigment{ rgb < 1.000000, 0.078431, 0.576471 > }
1214 finish{
1215 ambient .2
1216 diffuse .6
1217 specular 1
1218 roughness .001
1219 metallic
1220 }
1221 }
1222 }
1223 #end
1224
1225