////////////////////////////////////////////////////////////////////////////// // // By Avi Chami - December 2001 // This code is for use with POVRAY ray tracing 3d tool // // The generated graphics were used later on // my 'Armored Trains' game (on top of the enemy trucks) // // Look at the code for more comments // // For final rendering use 800X600 - AA // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // // Visit my site // // Games'n'Models - http://gnm5.tripod.com // // Use and distribute it freely - Please mention the source - Thanks // ////////////////////////////////////////////////////////////////////////////// #include "colors.inc" background{White} camera { angle 20 location <60, 600, -460> look_at <60, 1, 0> } light_source { <160, 40, -10> color White} light_source { <120, 20, -800> color White} // the machine gun ("torreta") is declared as the union of // several elements as discussed below #declare torreta = union { // machine gun body box { < 0, 0, 0 >, < 3, 3, 10 > pigment { Gray40 } } // machine gun bigger and smaller barrels // note that they are translated (displaced) forward (third parameter) // they also are translated on the x, y axis to align them with the center // of the previous box cylinder { <0,0,0>, <0,0,4>, 1 translate <1.5, 1.5, 10> pigment {Gray55} } cylinder { <0,0,0>, <0,0,6>, 0.3 translate <1.5, 1.5, 14> pigment {Gray65} } // this is the machine gun 'handle' a the side of the box cylinder { <3,0,0>, <3,2,0>, 0.5 translate <0, 2, 2> pigment {Black} } // and this is the ammunition box box { < 0, 0, 0 >, < 5, 4, 2 > translate <-5,-1,5> pigment { Green } } finish {diffuse 0.5} } // Now I show the machine gun at several angles // Later on I reduced them and addapted them for // usage on DIV object { torreta rotate 270*y translate <-40, 0, 0> } object { torreta rotate 255*y translate <-20, 0, 0> } object { torreta rotate 240*y translate <0, 0, 0> } object { torreta rotate 225*y translate <20, 0, 0> } object { torreta rotate 210*y translate <40, 0, 0> } object { torreta rotate 195*y translate <60, 0, 0> } object { torreta rotate 180*y translate <80, 0, 0> } object { torreta rotate 165*y translate <100, 0, 0> } object { torreta rotate 150*y translate <120, 0, 0> } object { torreta rotate 135*y translate <140, 0, 0> } object { torreta rotate 120*y translate <160, 0, 0> }
Make your own free website on Tripod.com