ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/xyz2pov/src/pov_writer.c
(Generate patch)

Comparing trunk/xyz2pov/src/pov_writer.c (file contents):
Revision 864 by gezelter, Tue Nov 18 17:04:25 2003 UTC vs.
Revision 868 by gezelter, Wed Nov 19 16:26:33 2003 UTC

# Line 284 | Line 284 | void make_header_macros(FILE *out_file){
284              "  #local z2 = end_2z;\n"
285              "\n"
286              "  #if(ROTATE)\n"
287 <            "    #local x1_new = A11 * x1 + A12 * y1 + A13 * z1;\n"
288 <            "    #local y1_new = A21 * x1 + A22 * y1 + A23 * z1;\n"
289 <            "    #local z1_new = A31 * x1 + A32 * y1 + A33 * z1;\n"
287 >            "    #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);\n"
288 >            "    #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);\n"
289 >            "    #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);\n"
290              "\n"
291 <            "    #local x2_new = A11 * x2 + A12 * y2 + A13 * z2;\n"
292 <            "    #local y2_new = A21 * x2 + A22 * y2 + A23 * z2;\n"
293 <            "    #local z2_new = A31 * x2 + A32 * y2 + A33 * z2;\n"
291 >            "    #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);\n"
292 >            "    #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);\n"
293 >            "    #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);\n"
294              "\n"
295              "  #else\n"
296              "    #local x1_new = x1;"
# Line 328 | Line 328 | void make_header_macros(FILE *out_file){
328              "\n"
329              "  #if(ROTATE)\n"
330              "\n"
331 <            "    #local x1_new = A11 * x1 + A12 * y1 + A13 * z1;\n"
332 <            "    #local y1_new = A21 * x1 + A22 * y1 + A23 * z1;\n"
333 <            "    #local z1_new = A31 * x1 + A32 * y1 + A33 * z1;\n"
331 >            "    #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);\n"
332 >            "    #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);\n"
333 >            "    #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);\n"
334              "\n"
335              "  #else\n"
336              "\n"
# Line 374 | Line 374 | void make_header_macros(FILE *out_file){
374              "  #local z3 = z1 + vz * (1.0 - CONE_FRACTION);\n"
375              "\n"
376              "  #if(ROTATE)\n"
377 <            "    #local x1_new = A11 * x1 + A12 * y1 + A13 * z1;\n"
378 <            "    #local y1_new = A21 * x1 + A22 * y1 + A23 * z1;\n"
379 <            "    #local z1_new = A31 * x1 + A32 * y1 + A33 * z1;\n"
377 >            "    #local x1_new = rotatePointX + A11 * (x1-rotatePointX) + A12 * (y1-rotatePointY) + A13 * (z1-rotatePointZ);\n"
378 >            "    #local y1_new = rotatePointY + A21 * (x1-rotatePointX) + A22 * (y1-rotatePointY) + A23 * (z1-rotatePointZ);\n"
379 >            "    #local z1_new = rotatePointZ + A31 * (x1-rotatePointX) + A32 * (y1-rotatePointY) + A33 * (z1-rotatePointZ);\n"
380              "\n"
381 <            "    #local x2_new = A11 * x2 + A12 * y2 + A13 * z2;\n"
382 <            "    #local y2_new = A21 * x2 + A22 * y2 + A23 * z2;\n"
383 <            "    #local z2_new = A31 * x2 + A32 * y2 + A33 * z2;\n"
381 >            "    #local x2_new = rotatePointX + A11 * (x2-rotatePointX) + A12 * (y2-rotatePointY) + A13 * (z2-rotatePointZ);\n"
382 >            "    #local y2_new = rotatePointY + A21 * (x2-rotatePointX) + A22 * (y2-rotatePointY) + A23 * (z2-rotatePointZ);\n"
383 >            "    #local z2_new = rotatePointZ + A31 * (x2-rotatePointX) + A32 * (y2-rotatePointY) + A33 * (z2-rotatePointZ);\n"
384              "\n"
385 <            "    #local x3_new = A11 * x3 + A12 * y3 + A13 * z3;\n"
386 <            "    #local y3_new = A21 * x3 + A22 * y3 + A23 * z3;\n"
387 <            "    #local z3_new = A31 * x3 + A32 * y3 + A33 * z3;\n"
385 >            "    #local x3_new = rotatePointX + A11 * (x3-rotatePointX) + A12 * (y3-rotatePointY) + A13 * (z3-rotatePointZ);\n"
386 >            "    #local y3_new = rotatePointY + A21 * (x3-rotatePointX) + A22 * (y3-rotatePointY) + A23 * (z3-rotatePointZ);\n"
387 >            "    #local z3_new = rotatePointZ + A31 * (x3-rotatePointX) + A32 * (y3-rotatePointY) + A33 * (z3-rotatePointZ);\n"
388              "\n"
389              "  #else\n"
390              "    #local x1_new = x1;"

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines