////////////////////////////////////////////////////////////////////////////// // // 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 the small 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 <35, 300, -160> look_at <35, 1, 0> } light_source { <60, 40, -10> color White} light_source { <80, 20, -800> color White} // This is another example of graphics I have done // It is a tank turret with two machine guns // The turret is done as the union of several objects as shown // below #declare torreta = union { // The body of the turret itself is done using sweep. On sweep we // actually define the form of the base of the prism, and then we // 'sweep', or stack it up, to form a box prism { linear_sweep linear_spline 0, // sweep the following shape from here ... 3, // ... up through here 6, // the number of points making up the shape ... <0,0.5>, <1,5>, <4,5>, <5,.5>, <4.5, 0>, <0.5,0> pigment { LightGrey } } // These are the two machine guns. This is like some early // light WWII tanks, armed with a pair of relatively small m. guns // Note how the cilinders are tranlated to the front of the // turret cylinder { <0,0,0>, <0,0,4>, 0.1 translate <2, 1.5, -1.6> pigment {Black} } cylinder { <0,0,0>, <0,0,6>, 0.1 translate <3.5, 1.5, -2.2> pigment {Black} } // And finally - A hatch on top of the turret cylinder { <0,0,0>, <0,0.3,0>, 0.8 translate <3.1, 3, 3.2> pigment {Gray45} } finish {diffuse 0.5} } // That's all - pretty easy - ain't it? // Now I show the turret at several angles to // be used on the game object { torreta rotate 90*y translate <-20, 0, 0> } object { torreta rotate 75*y translate <-10, 0, 0> } object { torreta rotate 60*y translate <0, 0, 0> } object { torreta rotate 45*y translate <10, 0, 0> } object { torreta rotate 30*y translate <20, 0, 0> } object { torreta rotate 15*y translate <30, 0, 0> } object { torreta rotate 0*y translate <40, 0, 0> } object { torreta rotate -15*y translate <50, 0, 0> } object { torreta rotate -30*y translate <60, 0, 0> } object { torreta rotate -45*y translate <70, 0, 0> } object { torreta rotate -60*y translate <80, 0, 0> }
Make your own free website on Tripod.com