The 3D Logo

The 3D Logo

After some thought about how to project this image into a three dimensional space, I came up with the image in Figure 23-5 .

Figure 23-5. Image of 3D logo.

I've included several area lights to make the logo appear brighter on all the visible sides so that it will show up better in this book. The code for this logo is really simple:

 // Persistence-of-Vision Ray-Tracer Scene Description File 
 // File: 3d_logo_1.pov 
 // Auth: Steve Murphy 
 
 // ==== Standard POV-Ray Includes ==== 
 #include "colors.inc" // Standard Color definitions 
 
 background { color White } 
 
 // camera { location <0, 20, 0> look_at <0, 0, 0> } // top 
 camera { location <0, 0, -30> look_at <0, 0, 0> } // front 
 // camera { location <-20, 0, 0> look_at <0, 0, 0> } // left 
 // camera { location <10, 10, -30> look_at <0, 0, 0> } // perspective 
 
 light_source { <0, 0, -130> color White } 
 light_source { <130, 0, 0> color White } 
 light_source { <-130, 0, 0> color White } 
 light_source { <0, 130, 0> color White } 
 light_source { <0, -130, 0> color White } 
 
 // larger box in the center 
 box { 
 <-3, -3, -3>, <3, 3, 3> 
 pigment { color Blue } 
 } 
 
 // make a box object 
 #declare myBox = box { 
 <-2, -2, -2>, <2, 2, 2> 
 pigment { color Blue } 
 } 
 
 object { myBox translate <-4, 4, -4> } // tlf 
 object { myBox translate <-4, -4, -4> } // blf 
 object { myBox translate <-4, 4, 4> } // tlb 
 object { myBox translate <-4, -4, 4> } // blb 
 object { myBox translate <4, 4, -4> } // trf 
 object { myBox translate <4, -4, -4> } // brf 
  object { myBox translate <4, 4, 4> } // trb  
  object { myBox translate <4, -4, 4> } // brb  
   
  // make a cone object  
  #declare myCone = cone {  
  <0, -3, 0>, 4  
  <0, 3, 0>, 0  
  pigment { color Green }  
  }  
   
  object { myCone translate <0, 9, 0> } // top  
  object { myCone rotate <180, 0, 0> translate <0, -9, 0> } // bottom  
  object { myCone rotate <0, 0, 90> translate <-9, 0, 0> } // left  
  object { myCone rotate <0, 0, -90> translate <9, 0, 0> } // right  
   
  // make a sphere object  
  #declare mySphere = sphere {  
  <0, 0, 0>, 2  
  pigment {color Red}  
  }  
   
  object { mySphere translate <0, 12, 0> }  
  object { mySphere translate <12, 0, 0> }  
  object { mySphere translate <0, -12, 0> }  
  object { mySphere translate <-12, 0, 0> }  

The first thing we do is set up the general stuff like the lighting and camera position. Then we define our basic shapes , or building blocks. Next we use our blocks to form each side of the logo. Each object is rotated and translated into its proper relative location from the coordinate <0, 0, 0>.

Once you're done with this example, try changing some textures or pigments, or add some new primitive objects to the scene and see what else you can come up with. Try to get fancy with it.

 



Multitool Linux. Practical Uses for Open Source Software
Multitool Linux: Practical Uses for Open Source Software
ISBN: 0201734206
EAN: 2147483647
Year: 2002
Pages: 257

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net