POV-Ray : Newsgroups : povray.windows : MUST, be very simple: Win bmp as texture on objects : Re: MUST, be very simple: Win bmp as texture on objects Server Time
18 Apr 2024 11:06:45 EDT (-0400)
  Re: MUST, be very simple: Win bmp as texture on objects  
From: Kenneth
Date: 1 Jan 2011 21:25:01
Message: <web.4d1fdd725827f18f196b08580@news.povray.org>
"syntotic" <nomail@nomail> wrote:
>... But I need and want the image to be manipulable as the face of a box or
> the background of a plane.
>
> What I got so far was... a background plane that shows the picture distorted as
> if the plane was hyperbolic space!...Tried scaling
> different ways but pixels are still stretched into elongated, eliptical
> cuadrangles.

From your description, it seems that the image and the plane are not aligned to
each other (?)

In any case, here's a simple workable example:
camera {
  location  <0, 0, 0>
  look_at   <0, 0, 300> // or just use look_at z
  right     x*image_width/image_height  // aspect
  angle 67

plane{z,300 // a vertical 'wall' 300 units into the far distance
     texture{
          pigment{
            image_map{sys "your_image.bmp" interpolate 2} // vertical by default
            translate <-.5,-.5,0> // optional, just to shift the 1 X 1
                                  // default-size image so that camera at
                                  // <0,0,0> can see *all* of it after the
                                  // scaling below
            scale 300 // or whatever will show the *full* image to the camera
                 }
          finish{ambient 1 diffuse 0}
            }
    }

Note that I left out the "once" keyword in the image map--that's to make sure
you see *something* on the plane (the image will be tiled infinitely in x and
y.)

But also note that this example assumes that your original image_map is a SQUARE
one; if it's not square, then the scaling needs to be changed to squash or
stretch your image in x, to get it to look correct. One easy way to do that is
to find the actual pixel dimension of your image--let's say it's 1000 pixels
wide by 500 pixels high--then do this instead: scale 300*<1000,500,1>/500  The
z-scaling isn't important here.

Hope this helps.

Ken


Post a reply to this message

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