prev index next 
Modelling Tips, Working With Primitives 
 POV-Ray Tips, 
 Tricks, and Techniques
Defining Planes? 
 
Mekanos muses: I'm new to raytracing.  I've been reading over the documentation in my POV-Ray, and I find the coverage on defining planes sort of vague.  Can anyone give me some more comprehensive help on how to define planes?  Especially finite planes...
 
Daniel A.K. Halsey "explanes":
The plane definition, as you probably know already, is:

plane
{
   [normal axis (direction)],      //important stuff
   [distance from origin]          //important stuff
   [any other operations, textures, etc.]  //less important stuff
}

What this means is:
The normal is a vector in the direction that points away from the "top" of the plane.  If, for instance, you want to make a nice non-descript, flat ground surface (a plain plain plane, if you will), and your camera is in a "conventional" position, your ground definition might look something like:

plane
{
   y,      //perpindicular to y-axis
   0       //at origin
   pigment { color rgb <0.7,0.5,0.3> }     //brownish
}

For a plane that tilts, you can either rotate it to suit your needs, or manipulate its normal to do the same:

plane {
   y,      //perp to y
   0
   rotate -45*z    //tilt -> right 45
}

-is the same as-

plane {
   < 1, 1, 0 >     //perp to axis in-between x and y
   0
}

As for the ever-elusive finite plane, a clipping statement is probably the way to go.  To do this, you have to encase both your plane and your clipping object inside an "object {}" statement.  A 2x2 plane can be defined as such:

object {
plane {
   z,
   0
   pigment { color rgb <0.7,0.5,0.3>}
}
clipped_by {
   box {
      < 1, 1, 1 >,
      < -1, -1, -1 >
      }
}
}

Similarly, a circular plane, radius 1, would be :
object {
plane {
   z,
   0
   pigment { color rgb <0.7,0.5,0.3>}
}
clipped_by {
   sphere {
        < 0, 0, 0 >,
        1
   }
}
}

Any object other than the other 2-D ones (triangles and such) can, as far as I know, be used to clip a plane.

I hope I've helped without being too long-winded (at least I didn't go into the "planes, like lines, are, by definition, infinite..." bit which some of my sick and twisted math-major [I'm CS] friends would have)
 

  1