POV-Ray : Newsgroups : povray.general : Background Images? Server Time
10 Aug 2024 17:22:36 EDT (-0400)
  Background Images? (Message 9 to 18 of 28)  
<<< Previous 8 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Ken
Subject: Re: Background Images?
Date: 7 Jan 2000 10:19:21
Message: <3875FF95.7DCE6A01@pacbell.net>
"mr.art" wrote:
> 
> sky_sphere takes a pigment. A pigment can use an image map. And an
> image_map can use map_type 1.
> sky_sphere { pigment { image_map {png "I:\Images\earth.png " map_type
> 1}}}
> 
> I used a large png file.

Mr Art,

 Could you please refrain from posting images to this group. If necessary
post in .images and tell where it is posted.

-- 
Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Paul Vanukoff
Subject: Re: Background Images?
Date: 7 Jan 2000 11:58:58
Message: <38761b52@news.povray.org>
Well ... maybe it wouldn't be *too* hard to write a little macro to position
a plane (or a flat box) a specified number of units (few thousand) away,
perpendicular to the camera's vector, and map an image onto at the right
size and ratio. If one knows one's mathematics that is .. hmm ...

--
Paul Vanukoff
van### [at] primenetcom


Nieminen Juha wrote in message <3875c1c9@news.povray.org>...
>  There's no way in povray to say "if the first ray shot from the camera
>doesn't hit anything, then take that pixel from this image".
>  This could be an interesting feature, though.
>
>--
>main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
>):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Mikael Carneholm
Subject: Re: Background Images?
Date: 7 Jan 2000 12:39:00
Message: <387624A9.770C0A88@ida.utb.hb.se>
Nieminen Juha wrote:

>   There's no way in povray to say "if the first ray shot from the camera
> doesn't hit anything, then take that pixel from this image".
>   This could be an interesting feature, though.

I've thought of this, too. Should fit in the background statement, if
background could take a pigment statement, like this:

background{
  pigment{
    image_map{
      ..
    }
  }
}

The BNF would then have to be modified to something like this:

<background_statement> ::= background { <color_statement> |
<pigment_statement> }
<color_statement> ::= color <3dim_def> <3dim_vector> | <4dim_def>
<4dim_vector>
<pigment_statement> ::= pigment { <const_color_statement> |
<image_map_statement> }
<4dim_def> ::= rgbt | rgbf
<3dim_def> ::= rgb
etc.


Post a reply to this message

From: Lance Birch
Subject: Re: Background Images?
Date: 7 Jan 2000 12:41:00
Message: <3876252c@news.povray.org>
Wouldn't it be MUCH simpler to use a format that outputs an alpha channel
and open it up in your favourite editor and simply overlay it onto the
background image with the alpha channel as the mask?

--
Lance.
The Zone - http://come.to/the.zone


Post a reply to this message

From: Chris Huff
Subject: Re: Background Images?
Date: 7 Jan 2000 12:41:22
Message: <chrishuff_99-2A343D.12413207012000@news.povray.org>
In article <3875c1c9@news.povray.org>, Nieminen Juha 
<war### [at] punarastascstutfi> wrote:

>   There's no way in povray to say "if the first ray shot from the camera
> doesn't hit anything, then take that pixel from this image".
>   This could be an interesting feature, though.

A "sky_plane" feature? Or "sky_box"? What about the reflections?
I think "sky_sphere" is sufficient. There is some distortion, but that 
can be corrected with the appropriate camera if the background image is 
rendered with POV-Ray.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: AC
Subject: Re: Background Images?
Date: 7 Jan 2000 15:26:44
Message: <38764c04@news.povray.org>
Why not make the background work like a object so one can use normals on it
and all the other fancy things too.

Another day is gone.
Ambis

Chris Huff  wrote :
> What memory constraints? The limit on the number of objects is so large
> I highly doubt you would ever reach it by accident. And to reach it on
> purpose would require a huge system, huge being an understatement.
>


Post a reply to this message

From: Chris Huff
Subject: Re: Background Images?
Date: 7 Jan 2000 15:43:30
Message: <chrishuff_99-298844.15434007012000@news.povray.org>
In article <38764c04@news.povray.org>, "AC" <amb### [at] teliacom> wrote:

> Why not make the background work like a object so one can use normals on 
> it and all the other fancy things too.

If you want that, why not just use an object?

The background and sky sphere are not real objects, but they behave like 
objects at an infinite distance. All light rays hit at the same angle, 
normals and finishes wouldn't make any useful difference in the 
appearance, they would be a waste of processing power, and things like 
reflection might be impossible. Especially blurred reflection.

The sky sphere is more than adequate for most things, and if you need 
something to act like a real object you should use a real object.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Chris Huff
Subject: Re: Background Images?
Date: 7 Jan 2000 15:53:48
Message: <chrishuff_99-209397.15535807012000@news.povray.org>
In article <387624A9.770C0A88@ida.utb.hb.se>, Mikael Carneholm 
<sa9### [at] idautbhbse> wrote:

> I've thought of this, too. Should fit in the background statement, if
> background could take a pigment statement, like this:
> 
> background{
>   pigment{
>     image_map{
>       ..
>     }
>   }
> }

That isn't possible with the background statement, because rays aren't  
always shot from the camera. Where on the image_map or pigment would you 
sample for a refracted or reflected ray?

The sky_sphere feature is basically this feature(a pigment for the 
background) with that problem solved by using the direction of the ray 
to sample the pigment as if a sphere with that pigment surrounded the 
origin of that ray. At least, that is how I understand it.

Having an image follow the camera might be useful, but it shouldn't be 
mixed up with the background statement. And it might be better solved 
with a macro. I think there are already macros that do this.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Josh English
Subject: Re: Background Images?
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

From: Josh English
Subject: Re: Background Images?
Date: 7 Jan 2000 19:27:00
Message: <3876844C.ACFCA5BC@spiritone.com>
Ooops... the code was adapted from John VanSickle, not Peter Popov. Sorry for the
mistaked credit.

J


Post a reply to this message

<<< Previous 8 Messages Goto Latest 10 Messages Next 10 Messages >>>

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