Difference between revisions of "HowTo:Build a basic scene"

From POV-Wiki
Jump to navigation Jump to search
(work aids ruler and axis display used when building scenes)
 
m (greets august0815)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
Sometimes it's helpful to have a sort of "ruler" to gauge how far things are apart and if you're close to the "floor" and have a checker pattern you can scale the checkers as '10' on a square but if you're up in the air and don't have the floor for a reference you can use an object you build yourself to gauge the distance.  Here's how to build a simple ruler:
 
Sometimes it's helpful to have a sort of "ruler" to gauge how far things are apart and if you're close to the "floor" and have a checker pattern you can scale the checkers as '10' on a square but if you're up in the air and don't have the floor for a reference you can use an object you build yourself to gauge the distance.  Here's how to build a simple ruler:
  
 +
<pre>
 
// ruller.inc as of 07Feb2009  // yeah, I know I've misspelled ruler.  It's a way to prevent name collision.
 
// ruller.inc as of 07Feb2009  // yeah, I know I've misspelled ruler.  It's a way to prevent name collision.
  
Line 21: Line 22:
 
}
 
}
 
#end
 
#end
 +
</pre>
  
 
Your ruler will display aligned along the x-axis and you can rotate / translate it to where you need it.
 
Your ruler will display aligned along the x-axis and you can rotate / translate it to where you need it.
Line 28: Line 30:
 
Alternately, you might need a quick reference to which axis is where and I've built an axis indicator to use myself.  Here it is:
 
Alternately, you might need a quick reference to which axis is where and I've built an axis indicator to use myself.  Here it is:
  
 +
<pre>
 
// origin axis display  this file is  axis.inc as of 07Feb2009
 
// origin axis display  this file is  axis.inc as of 07Feb2009
 
                      
 
                      
Line 145: Line 148:
  
 
#end
 
#end
 +
</pre>
  
 
You build an axis display by declaring : object { MyAxisDisplay [modifiers go here] }
 
You build an axis display by declaring : object { MyAxisDisplay [modifiers go here] }
 +
 +
Also helpful is a blueprint or 3-views to guide your work.  You can put an image_map on a simple box to show you where the various components go like this:
 +
<pre>
 +
object {
 +
box{
 +
  <0,0,0>,<1,1,1>
 +
pigment{
 +
      image_map{ gif "side view.gif"
 +
        }
 +
      }
 +
    scale<940,300,0.1>
 +
  no_shadow
 +
 +
  }
 +
 +
}
 +
</pre>

Latest revision as of 19:40, 15 April 2009

Sometimes it's helpful to have a sort of "ruler" to gauge how far things are apart and if you're close to the "floor" and have a checker pattern you can scale the checkers as '10' on a square but if you're up in the air and don't have the floor for a reference you can use an object you build yourself to gauge the distance. Here's how to build a simple ruler:

// ruller.inc as of 07Feb2009  // yeah, I know I've misspelled ruler.  It's a way to prevent name collision.

#ifndef( Ruller_Inc_Temp)  
#declare Ruller_Inc_Temp = version;

#include "colors.inc"	// comment this out when you're through with it
#declare DisplayFont = "arial.ttf"

#declare MyRuller = text {
  ttf             // font type (only TrueType format for now)
  DisplayFont,
  "0.....|....20....|......40.....|....60.....|.....80.....|.....100",      // the string to create
  1,              // the extrusion depth
  0               // inter-character spacing
  //rotate 90*y
  scale <5,5,1>
  translate <0,2,0>
  texture{pigment{Light_Purple}}
}
#end

Your ruler will display aligned along the x-axis and you can rotate / translate it to where you need it.

You can calibrate the ruler by comparing it to the checkered floor and adjust by adding or removing '.'s between the numbers. I use it when I'm building a scene.

Alternately, you might need a quick reference to which axis is where and I've built an axis indicator to use myself. Here it is:

// origin axis display   this file is  axis.inc as of 07Feb2009
                     
#ifndef( ORIGIN_Inc_Temp)  
#declare ORIGIN_Inc_Temp = version;
                                 
#include "colors.inc"

#declare DisplayFont = "arial.ttf"

// let's label the origin of the scene with a black sphere
#declare MyOrigin = object {
     sphere {
         <0, 0, 0> // center of sphere <X Y Z>
         1.0       // radius of sphere
        texture{
           pigment{Black}
        }
     }  
}   
//---------------------------------------------                                
// X-axis pointer:
#declare MyXPointer = union {
cylinder {
    0*x,  10*x,  1
    open
    texture{
       pigment{ Red }
    }
}
cone {
  10*x,  1.0,
  11*x, 0.0
   texture{pigment{ Red}}
}

text {
  ttf             // font type (only TrueType format for now)
  DisplayFont,
  "X",      // the string to create
  1,              // the extrusion depth
  0               // inter-character spacing
  //rotate 90*y
  scale <5,5,1>
  translate <11,2,0>
  texture{pigment{Red}}
}
}
//------------------------------------------------
// y-axis pointer:
#declare MyYPointer = 
union {
cylinder {
    0*y,  10*y,  1
    open
    texture{
       pigment{ White }
    }
}
cone {
  10*y,  1.0,
  11*y, 0.0
   texture{pigment{ White}}
}

text {
  ttf             // font type (only TrueType format for now)
  DisplayFont,
  "Y",      // the string to create
  1,              // the extrusion depth
  0               // inter-character spacing
  //rotate 90*y
  scale <5,5,1>
  translate <5,9,5>
  texture{pigment{White}}
  
}      
}

//------------------------------------------------
// z-axis pointer:
#declare MyZPointer = 
union {
cylinder {
    0*z,  10*z,  1
    open
    texture{
       pigment{ Blue }
    }
}
cone {
  10*z,  1.0,
  11*z, 0.0
   texture{pigment{ Blue}}
}

text {
  ttf             // font type (only TrueType format for now)
  DisplayFont,
  "Z",      // the string to create
  1,              // the extrusion depth
  0               // inter-character spacing
  //rotate 90*y
  scale <5,5,1>
  translate <2,5,11>
  texture{pigment{Blue}}
  
}
}
#declare MyAxisDisplay = 
union {          
	object {MyOrigin }
	object {MyXPointer}
	object {MyYPointer}
	object {MyZPointer}
}

#end

You build an axis display by declaring : object { MyAxisDisplay [modifiers go here] }

Also helpful is a blueprint or 3-views to guide your work. You can put an image_map on a simple box to show you where the various components go like this:

object {
	box{
   	<0,0,0>,<1,1,1>
		pigment{
       	image_map{ gif "side view.gif" 
         }
      }
     scale<940,300,0.1>
	  no_shadow

   }

}