Propeller Engine |
#macro Radial_Rotor_TextureX (Number_of_Radial_Stripes)
radial
frequency Number_of_Radial_Rtripes // = number of blades
rotate<90,0,0>
texture_map { [0.00 pigment {color rgbt<1,1,1,0.5>}
finish {ambient 0.15 diffuse 0.85
phong 0.1}]
[0.60 pigment{color Clear}]
[1.00 pigment{color Clear}]
}
#end //----------------------------------- other textures
#declare Blades_Texture =
texture { Chrome_Metal
finish {ambient 0.10 diffuse 0.80 phong 1}}
#declare Engine_Texture =
texture { pigment{color rgb<1,1,1>}
finish {ambient 0.15 diffuse 0.85 phong 1}}
//-------------------------------------------------------
#macro Engine(Number_Blades, B_Length, R_Angle, Activate_B)
union{ // --------------------- the casing of the engine
torus{1.0,0.175 rotate<90,0,0>
scale <1,1,5>*0.35
texture{Engine_Texture}
translate<0,0,-0.3>
} // end of torus
difference {
sphere { <0,0,0>,1 scale <0.35,0.35,1.3>
translate<0,0,0.5>}
box { <-1,-1,-1.2>,<1,1,-0.48>}
texture{Engine_Texture}
}
union{ // propeller
cylinder{ <0,0,-0.01>,<0,0,1.00>,0.10}// propeller axis
difference{ sphere{<0,0,0>, 1} // propeller nose
box {<-1,-1,-0.1>,<1,1,1>}
scale <1,1,2.5>*0.3
translate<0,0,0.2>
texture{Blades_Texture}
}
union{ // --------------------------------- the blades
#declare Nr = 0;
#declare End = Number_Blades;
#while ( Nr < End)
sphere { <0,0,0>,0.5
scale <1,0.15,0.04>
translate <0.5,0,0>
rotate <10,0,0>
scale B_Length // = Blade_Radius
texture {Blades_Texture}
rotate< 0,0, 360/End * Nr >
}
#declare Nr = Nr + 1;
#end // end of #while ------------------------------
#if (Activate_B = 1) // --------------------------- blur
cylinder { <0,0,0>,<0,0,0.001>, B_Length
texture{ Radial_Rotor_TextureX(Number_Blades)}
rotate <0, 0,0>
translate <0,0, 0.025>
}
#end // end of #if (Activate_B = 1) ---------------------
} // end of union of the blades
translate<0,0,-0.7>
rotate<0,0,R_Angle>
} // --------------------------------- end of union "Propeller"
} // --------------------------------------- end of union engine
#end // -------------------------- end of macro "Engine ( ... )"
// using this macro:
//Engine(Number_of_Blades, Blade_Radius, Rotation_Angle, Rotor_On)
object{ Engine( 5, 2.35, 10, 1)
translate <0.80,5.60,-1.90>
rotate<0,-15,0>
}
object{ Engine( 3, 2.00, 20, 0)
translate <-3,5.5,-0.20>
rotate<0,-45,0>
}
// ---------------------------------------------------------- end |