1 |
+ |
#define _FILE_OFFSET_BITS 64 |
2 |
+ |
|
3 |
|
#include <stdio.h> |
4 |
|
#include <stdlib.h> |
5 |
|
#include <string.h> |
286 |
|
" #local z2 = end_2z;\n" |
287 |
|
"\n" |
288 |
|
" #if(ROTATE)\n" |
289 |
< |
" #local x1_new = A11 * x1 + A12 * y1 + A13 * z1;\n" |
290 |
< |
" #local y1_new = A21 * x1 + A22 * y1 + A23 * z1;\n" |
291 |
< |
" #local z1_new = A31 * x1 + A32 * y1 + A33 * z1;\n" |
289 |
> |
" #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);\n" |
290 |
> |
" #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);\n" |
291 |
> |
" #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);\n" |
292 |
|
"\n" |
293 |
< |
" #local x2_new = A11 * x2 + A12 * y2 + A13 * z2;\n" |
294 |
< |
" #local y2_new = A21 * x2 + A22 * y2 + A23 * z2;\n" |
295 |
< |
" #local z2_new = A31 * x2 + A32 * y2 + A33 * z2;\n" |
293 |
> |
" #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);\n" |
294 |
> |
" #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);\n" |
295 |
> |
" #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);\n" |
296 |
|
"\n" |
297 |
|
" #else\n" |
298 |
|
" #local x1_new = x1;" |
330 |
|
"\n" |
331 |
|
" #if(ROTATE)\n" |
332 |
|
"\n" |
333 |
< |
" #local x1_new = A11 * x1 + A12 * y1 + A13 * z1;\n" |
334 |
< |
" #local y1_new = A21 * x1 + A22 * y1 + A23 * z1;\n" |
335 |
< |
" #local z1_new = A31 * x1 + A32 * y1 + A33 * z1;\n" |
333 |
> |
" #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);\n" |
334 |
> |
" #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);\n" |
335 |
> |
" #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);\n" |
336 |
|
"\n" |
337 |
|
" #else\n" |
338 |
|
"\n" |
376 |
|
" #local z3 = z1 + vz * (1.0 - CONE_FRACTION);\n" |
377 |
|
"\n" |
378 |
|
" #if(ROTATE)\n" |
379 |
< |
" #local x1_new = A11 * x1 + A12 * y1 + A13 * z1;\n" |
380 |
< |
" #local y1_new = A21 * x1 + A22 * y1 + A23 * z1;\n" |
381 |
< |
" #local z1_new = A31 * x1 + A32 * y1 + A33 * z1;\n" |
379 |
> |
" #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);\n" |
380 |
> |
" #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);\n" |
381 |
> |
" #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);\n" |
382 |
|
"\n" |
383 |
< |
" #local x2_new = A11 * x2 + A12 * y2 + A13 * z2;\n" |
384 |
< |
" #local y2_new = A21 * x2 + A22 * y2 + A23 * z2;\n" |
385 |
< |
" #local z2_new = A31 * x2 + A32 * y2 + A33 * z2;\n" |
383 |
> |
" #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);\n" |
384 |
> |
" #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);\n" |
385 |
> |
" #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);\n" |
386 |
|
"\n" |
387 |
< |
" #local x3_new = A11 * x3 + A12 * y3 + A13 * z3;\n" |
388 |
< |
" #local y3_new = A21 * x3 + A22 * y3 + A23 * z3;\n" |
389 |
< |
" #local z3_new = A31 * x3 + A32 * y3 + A33 * z3;\n" |
387 |
> |
" #local x3_new = rotatePointX + A11 * (x3-rotatePointX) + A12 * (y3-rotatePointY) + A13 * (z3-rotatePointZ);\n" |
388 |
> |
" #local y3_new = rotatePointY + A21 * (x3-rotatePointX) + A22 * (y3-rotatePointY) + A23 * (z3-rotatePointZ);\n" |
389 |
> |
" #local z3_new = rotatePointZ + A31 * (x3-rotatePointX) + A32 * (y3-rotatePointY) + A33 * (z3-rotatePointZ);\n" |
390 |
|
"\n" |
391 |
|
" #else\n" |
392 |
|
" #local x1_new = x1;" |