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)
 
Line 147: Line 147:
  
 
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:
 +
 +
object {
 +
box{
 +
  <0,0,0>,<1,1,1>
 +
pigment{
 +
      image_map{ gif "side view.gif"
 +
        }
 +
      }
 +
    scale<940,300,0.1>
 +
  no_shadow
 +
 +
  }
 +
 +
}

Revision as of 04:12, 16 February 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.

  1. ifndef( Ruller_Inc_Temp)
  2. declare Ruller_Inc_Temp = version;
  1. include "colors.inc" // comment this out when you're through with it
  2. declare DisplayFont = "arial.ttf"
  1. 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}}

}

  1. 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

  1. ifndef( ORIGIN_Inc_Temp)
  2. declare ORIGIN_Inc_Temp = version;
  1. include "colors.inc"
  1. declare DisplayFont = "arial.ttf"

// let's label the origin of the scene with a black sphere

  1. declare MyOrigin = object {
    sphere {
        <0, 0, 0> // center of sphere <X Y Z>
        1.0       // radius of sphere
       texture{
          pigment{Black}
       }
    }  

} //--------------------------------------------- // X-axis pointer:

  1. 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:

  1. 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:

  1. 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}}
 

} }

  1. declare MyAxisDisplay =

union { object {MyOrigin } object {MyXPointer} object {MyYPointer} object {MyZPointer} }

  1. 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

  }

}