POV-Ray : Newsgroups : povray.general : Background Images? : Re: Background Images? Server Time
10 Aug 2024 17:25:56 EDT (-0400)
  Re: Background Images?  
From: Josh English
Date: 7 Jan 2000 19:24:07
Message: <3876839E.CC3285A7@spiritone.com>
I came up with this solution a month ago for another similar post:
Here is the code.
#local CamLook = <0,0,3>; // Camera's Look_at
#local CamLoc = <0,0.5,-6>; //where the camera's location is
#local cam_z = 2; //the amount of camera zoom you want
#local back_dist = 100; // how far away the background is
#local cam_a = 4/3; // camera aspect ratio
#local cam_s = <0,1,0>; // camera sky vectoy
#local cam_d = vnormalize(CamLook-CamLoc);
#local cam_r = vnormalize(vcross(cam_s,cam_d));
#local cam_u = vnormalize(vcross(cam_d,cam_r)); // camera up vector
#local cam_dir = cam_d * cam_z;
#local cam_right = cam_r * cam_a;

#declare fz = vlength(cam_dir);
#declare fx = vlength(cam_right)/2;
#declare fy = vlength(cam_u)/2;

camera {
  location CamLoc
  up cam_u
  right cam_r * cam_a
  direction (cam_d * cam_z)
}

box { <0,0,0> <1,1,0.1>
      pigment { image_map { png "background.png"
                                             map_type 0
                                             interpolate 2 } }
      translate <-0.5,-0.5,0>
      scale 2*<fx,fy,0.5>
      translate fz*z
      scale back_dist
      #local nz = vnormalize(CamLook-CamLoc);
      #local nx = vnormalize(vcross(cam_s,nz));
      #local ny = vcross(nz,nx);
      matrix <nx.x,nx.y,nx.z,
               ny.x,ny.y,ny.z,
              nz.x,nz.y,nz.z,
              CamLoc.x,CamLoc.y,CamLoc.z> }


It uses a variation on the code that Peter Popov (I beleive) created to add a
renderd signature to scenes.

Josh English
eng### [at] spiritonecom

Valerie Robbins wrote:

> Is it possible with POV Ray 3.1 to put in a background image.  I know about
> the sky sphere, but I would like to have my objects in the foreground, and
> then a bitmap (or some other graphic format) in the back, like a picture of
> some snowy mountians.  Is this possible without actually modelling the
> mountains?  I know that many software packages have features like this, but
> I'm at a loss to find anything mentioned in the POV documentation on it.
>
> -Val


Post a reply to this message

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