POV-Ray : Newsgroups : povray.text.scene-files : What is it? HF checkers : What is it? HF checkers Server Time
28 Jul 2024 20:28:57 EDT (-0400)
  What is it? HF checkers  
From: Bob
Date: 7 Jun 1999 08:38:28
Message: <375BBD21.90CB585F@aol.com>
This script will allow you to first make a image consisting of pixel sized
black and white checkers. Then you can use it as a HF with the same image
mapped onto that.
In case you have never done a pixelized checker pattern you're in for a
treat, or a disappointment, when you see how well, or badly, your monitor
displays pixels. I clicked and dragged the resulting image around to see
the monitor corners too. I have a terrible display here, .39 dot pitch I
already knew, but it's awful.
Well, anyway, reason for all this is to see what a HF is made up of, at
least an attempt to. I looked from all sorts of vantage points and camera
angles and darned if I know yet what it is. Triangles perhaps? Well, if
you try this you may be surprised at what's going on. Don't just use the
camera settings I have put here, try several ways of looking at this. One
time I saw 3 levels (instead of one each) of white and black "stripes",
not the expected white peaks and black valleys. Maybe I'm doing this all
wrong. Here it is to check out.


// Persistence of Vision Ray Tracer Scene Description File
// File: pixels_hf.pov
// Vers: 3.1
// Desc: height field using B&W checkered pixel image map and how the pixels are
mapped
// Date: 99.43 
// Auth: Bob Hughes
// Note: Use +w500 +h500 +fn +oC:\Images\bw_pixel.png to create the initial image
// from then on set P to 2 and remove the above command line, use your usual INI
settings

//As is set up you will see the bottom-left corner of the HF. Watch for line wrap too.

#declare P = 2;  //1 to create pixelated image, 2 for height field using that image
#declare Zoom = .05; //HF viewing. less to magnify, more to zoom out [0.005 to 1]
#declare Center = 0; //HF centering. 0 to focus on bottom-left corner, 1 to center
#declare H = .1; //HF y axis height scale multiplier. 1 for cube, less for flattened
box

//light_source { <1.5,1.5,-1.5> color rgb 1.5 }

#switch (P)
#case (1)

global_settings { hf_gray_16 on }

camera {
 orthographic
  location  <0,0,-3>
  up 1*y right 1*x
  look_at   <0,0,0>
}

plane {z,0 pigment {checker color rgb 0 color rgb 1 scale .002 rotate -90*x}
 finish {ambient 1}}

#break
#case (2)

global_settings { hf_gray_16 off }

camera {
 //orthographic
  location  <0,0,-3>
  up Zoom*1*y right Zoom*1*x
  look_at   <0,0,0>
}

background {rgb <1,.5,.25>}

height_field {
  png "c:\images\bw_pixel.png" //smooth
  texture { pigment {
      image_map { png "c:\images\bw_pixel.png"
         map_type 0 //interpolate 2 once
         } rotate 90*x
    }
     finish {ambient 1}  //make visible
  }
   translate -.5*Center
    scale <1,1*H,1>
 //sawtooth pattern view (top of HF is turned 45 degrees toward the camera)
     rotate <-45,0,0>
 }

#end
//END


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.