8.附錄

參考書目:

Photorealism and Ray Tracing in C
Chistopher D. Watkins,
Stephen B. Coy,
and Mark Finlay

立體電腦動畫實作技巧
3D STUDIO
廖純慶 著

3D STUDIO 參考手冊 模型篇
陳建財 著






FILENAME:COLOR.BC

此為color顏色的定義檔,用#define後的字代替後面color的數值。
例如:用blue代替(0 0 1)
Bob header file with standard color definitions

//========================================================== #define aquamarine (.439216 .858824 .576471) #define black (0 0 0) #define blue (0 0 1) #define blue_violet (.623529 .372549 .623529) #define brilliant_red (.68 .405 .405) #define brown (.647059 .164706 .164706) #define cadet_blue (.372549 .623529 .623529) #define coral (1 .498039 0) #define cornflower_blue (.258824 .258824 .435294) #define cyan (0 1 1) #define dark_blue (.1941 .1941 .623529) #define dark_brown (.1941 .0492 .0492) #define dark_gray (.329412 .329412 .329412) #define dark_grey (.329412 .329412 .329412) #define dark_green (.184314 .309804 .184314) #define dark_olive_green (.309804 .309804 .184314) #define dark_orchid (.6 .196078 .8) #define dark_plum (.45 .34 .45) #define dark_slate_blue (.419608 .137255 .556863) #define dark_slate_gray (.184314 .309804 .309804) #define dark_slate_grey (.184314 .309804 .309804) #define dark_tan (.51 .35 .264) #define dark_turquoise (.439216 .576471 .858824) #define dim_brown (.384 .096 .096) #define dim_gray (.329412 .329412 .329412) #define dim_grey (.329412 .329412 .329412) #define firebrick (.556863 .137255 .137255) #define forest_green (.137255 .556863 .137255) #define gold (.6 .5 .26) #define goldenrod (.858824 .858824 .439216) #define gray (.752941 .752941 .752941) #define green (0 1 0) #define green_yellow (.576471 .858824 .439216) #define grey (.752941 .752941 .752941) #define indian_red (.309804 .184314 .184314) #define khaki (.623529 .623529 .372549) #define light_blue (.74902 .847059 .847059) #define light_gray (.658824 .658824 .658824) #define light_grey (.658824 .658824 .658824) #define light_sky_blue ((135 206 235)/255) #define light_steel_blue (.560784 .560784 .737255) #define lime_green (.196078 .8 .196078) #define magenta (1 0 1) #define maroon (.556863 .137255 .419608) #define medium_aquamarine (.196078 .8 .6) #define medium_blue (.196078 .196078 .8) #define medium_brown (.455 .112 .115) #define medium_forest_green (.419608 .556863 .137255) #define medium_goldenrod (.917647 .917647 .678431) #define medium_gray (.5 .5 .5) #define medium_grey (.5 .5 .5) #define medium_orchid (.576471 .439216 .858824) #define medium_plum (.55 .40 .55) #define medium_sea_green (.258824 .435294 .258824) #define medium_slate_blue (.498039 0 1) #define medium_spring_green (.498039 1 0) #define medium_turquoise (.439216 .858824 .858824) #define medium_violet_red (.858824 .439216 .576471) #define midnight_blue (.184314 .184314 .309804) #define navy (.137255 .137255 .556863) #define navy_blue (.137255 .137255 .556863) #define orange (.8 .196078 .196078) #define orange_red (1 0 .498039) #define orchid (.858824 .439216 .858824) #define pale_green (.560784 .737255 .560784) #define pink (.737255 .560784 .560784) #define plum (.917647 .678431 .917647) #define red (1 0 0) #define salmon (.435294 .258824 .258824) #define sea_green (.137255 .556863 .419608) #define sienna (.556863 .419608 .137255) #define silver (.6 .6 .7) #define sky_blue (.196078 .6 .8) #define slate_blue (0 .498039 1) #define spring_green (0 1 .498039) #define steel_blue (.137255 .419608 .556863) // this was just "tan" but now tan is a keyword #define medium_tan (.858824 .576471 .439216) #define thistle (.847059 .74902 .847059) #define turquoise (.678431 .917647 .917647) #define violet (.309804 .184314 .309804) #define violet_red (.8 .196078 .6) #define wheat (.847059 .847059 .74902) #define white (1 1 1) #define yellow (1 1 0) #define yellow_green (.6 .8 .196078)


TESTURE.BS

此為一表面和材質的定義,可供參考及使用


//==========================================================

/*                                                        */

/*  Surface definitions and textures for Vivid 2.0        */

/*  Compiled by Adam Shiffman                             */

/*  The Graphics Alternative, (510) 524-2780              */

/*                                                        */

/*                                                        */

/*  Note: these textures and surfaces are not guaranteed  */

/*        to do anything except take up disk space and    */

/*        use memory when included in your data file!     */

/*                                                        */

/*  Hint: Some of the surfaces will need to be rescaled   */

/*        for your particular needs.  This is by no       */

/*        means a intended to be a complete textures      */

/*        file for Vivid, it is sparse and needs to be    */

/*        enhanced!!   Edit and modify as much as you     */

/*        wish!!                                          */

/*                                                        */

//==========================================================

#define white_plastic

        surf { diff .8 .8 .8 shine 200 white }

#define blue_plastic

        surf { diff blue shine 200 white }

#define red_plastic

        surf { diff red shine 200 white }

#define mirror_glass                                  \

        surf { spec .9 .9 .9 trans .9 .9 .9  }

#define red_glass

        surf { trans 1 .1 .25 ior 1.2 shine 100 white }

#define dark_violet_sky

        surf {

            texture {

                   pattern checker

                   scale 14 23 0

                   blend .8

                   turb {

                       terms 4

                       amp 3

                       }

                   surf { diff blue_violet amb blue_violet }

                   surf { diff black }

                   }

             }

#define blue_cloudy_sky

        surf {

            texture {

                   pattern checker

                   scale 14 23 0

                   blend .8

                   turb {

                       terms 4

                       amp 3

                       }

                   surf { diff white amb .8 .8 .8 }

                   surf { diff sky_blue amb sky_blue }

                   }

             }

#define spun_chrome

        surf {

            bump {

                turb {

                    scale 25 25 .025

                    amp .25

                    terms 1

                    }

                }

            diff light_steel_blue spec .4 .4 .5 shine 20

            }

#define white_pine

        surf {

            texture {

                   turb {

                       scale 1.1 .9 1

                       amp .2

                       terms 3

                       }

                   pattern spherical

                   scale 0 1 1

                   offset 0 0 1

                   blend .5

                   radius .05

                   radius .02

                   surf { diff brown shine 100 white }

                   surf { diff medium_tan shine 100 white }

                   }

            }



#define varnished_pine

    surf {

        texture {

               turb {

                   scale .1 .9 1

                   amp .3

                   terms 3

                    }

               pattern spherical

               scale 0 1 1

               blend .5

               radius .15

               radius .12

               surf {

                   texture {

                           pattern noise

                           scale 3 .03 .03

                           terms 2

                           surf { diff brown

                                  shine 100 white }

                           surf { diff medium_tan

                                  shine 100 white }

                           }

                     }

               surf {

                   texture {

                           pattern noise

                           scale 3 .03 .03

                           terms 2

                           surf { diff .388235 .098823 .098823

                                  shine 20 white }

                           surf { diff .515294 .345882 .263529

                                  shine 20 white }

                           }

                    }

              }

        }



#define proto_planet

      surf {

          texture {

                 pattern

                 checker

                 scale .5 0 0

                 blend .75

                 surf { diff .8412699 .2380952 .0952381

                        shine 20 }

                 surf { diff .6349207 .1111111 0

                        shine 20 }

                 turb {

                     terms 2

                     amp 4

                       }

                   }

            }

#define steel_plasticine

       surf { diff light_steel_blue shine 250 }

#define blue_marble

       surf {

           texture {

                   pattern spherical

                   turb {

                       terms 7

                       amp 6

                        }

                    blend .8

                    radius .5

                    radius 2

                    surf { diff 0 .1 .2 shine 20 white }

                    surf { diff .8 .8 .8 shine 20 white }

                    }

            }

#define red_marble

        surf {

            texture {

                    pattern spherical

                    turb {

                         terms 7

                         amp 6

                         }

                    blend .8

                    radius .5

                    radius 1.35

                    surf { diff .38 .07 0 shine 50 white }

                    surf { diff .8 .8 .8 shine 50 white }

                   }

            }

#define green_marble

        surf {

             texture {

                     pattern spherical

                     turb {

                          terms 7

                          amp 6

                          }

                     blend .8

                     radius .5

                     radius 1.35

                     surf { diff .07 .38 0 shine 50 white }

                     surf { diff .8 .8 .8 shine 50 white }

                    }

            }



#define metallic_gold

        surf { diff gold spec .7 .7 .7 shine 10 white }

#define metallic_silver

        surf { diff light_silver spec .8  .8 .8 shine 10 white }

#define hazy_grey_noise

        surf {

             texture {

                     pattern noise

                     blend .3

                     terms 4

                     surf { diff black }

                     surf { diff white }

                     }

            }

#define grey_ripples

        surf {

                texture {

                        pattern noise

                        scale .2 .2 .5

                        terms 2

                        surf { diff black }

                        surf { diff white }

                        }

             }

#define blue_planet

        surf {

                texture {

                        pattern noise

                        terms 5

                        scale 1.5 1.5 1.5

                        surf { diff sky_blue }

                        surf { diff white }

                        }

             }

#define crater_moon

             surf {

                  texture {

                          pattern noise

                          terms 1

                          scale .4 .4 .4

                          surf { diff .7 .7 .7 }

                          surf { diff .5 .5 .5 }

                          }

                  bump {

                          turb {

                                scale .125 .125 .05

                                offset 0 0 0

                                amp .3

                                terms 8

                                }

                       }

             }

#define composite_bulkhead

      surf {

          texture {

                pattern noise

                terms 5

                blend .6

                scale .0125 4 4

                surf { diff charcoal }

                surf { diff .7 .7 .7 }

               }

        }

#define granite

        surf {

            texture {

                pattern noise

                terms 4

                blend 0

                scale .05 .05 .05

                surf { diff .7 .7 .7 }

                surf { diff .15 .15 .15 }

                   }

                no_antialias

            }

#define maroon_nebula

        surf {

                texture {

                        pattern checker

                        scale 28 46 46

                        blend .8

                        turb {

                                terms 4

                                amp 3

                        }

                        surf { diff maroon  }

                        surf { diff black  }

                }

          }

#define dark_blue_ripples

        surf {

                texture {

                        pattern noise

                        terms 5

                        scale 4.75 4.75 4.75

                        surf { diff dark_orchid }

                        surf { diff black }

                        }

             }

#define blue_sky

        surf {

                texture {

                        pattern checker

                        scale 10 18 0

                        blend .8

                        turb {

                                terms 4

                                amp 3

                        }

                        surf { diff blue amb blue }

                        surf { amb white }

                }

          }

#define mini_blue_sky

        surf {

                texture {

                        pattern checker

                        scale 2 6 5

                        blend .8

                        turb {

                                terms 4

                                amp 3

                              }

                         surf { diff white amb .8 .8 .8 }

                         surf { diff sky_blue amb sky_blue}

                        }

             }

#define real_chrome

        surf { diff .1 .1 .1 spec .95 .95 .95 shine 10 white }

#define small_checkers

        surf {

                texture {

                        pattern checker

                        scale 1.5 1.5 0

                        blend 0

                        surf { diff white spec .2 .2 .2 }

                        surf { diff black spec .2 .2 .2 }

                         }

          }





#define medium_checkers

        surf {

                texture {

                        pattern checker

                        scale 4 4 0

                        blend 0

                        surf { diff white spec .2 .2 .2 }

                        surf { diff black spec .2 .2 .2 }

                         }

          }





#define large_checkers

        surf {

                texture {

                        pattern checker

                        scale 8 8 0

                        blend 0

                        surf { diff white spec .2 .2 .2 }

                        surf { diff black spec .2 .2 .2 }

                         }

          }



#define shiny_bumpy_gold

  surf {

           bump {

                   turb {

                           scale .075 .075 .075

                           amp .25

                           terms 1

                         }

                 }

             diff gold spec .4 .4 .4 shine 20

       }



#define bumpy_moon

  surf {

           bump {

                   turb {

                           scale .05 .05 .05

                           amp .25

                           terms 1

                         }

                 }

             diff khaki

       }





#define khaki_forest_landscape

   surf {

          texture {

                pattern noise

                terms 1

                scale .4 .4 .8

                surf { diff dark_olive_green }

                surf { diff khaki }

                }



                bump {

                        turb {

                                scale .5 .5 .5

                                amp .25

                                terms 4

                              }

                      }

              }



#define medium_red_checkers

        surf {

                texture {

                        pattern checker

                        scale 4 4 0

                        blend 0

                        surf { diff white  }

                        surf { diff red   }

                         }

          } 


//以下是我們在專題製作過程中曾經用到的一些執行或轉圖的程式 //==========================================================