 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Val, please see POV-Ray documentation, section 4.7.1.5 - "Image Maps".
Yes, an image can be used as a background or mapped to objects. Photo
images of people, product labels, or even other rendered images may be
used.
On Thu, 6 Jan 2000 21:20:40 -0800, in message
<3875761d@news.povray.org>, "Valerie Robbins" <vro### [at] earthlink net>
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.
--
Alan - ako### [at] povray org - a k o n g <at> p o v r a y <dot> o r g
http://www.povray.org - Home of the Persistence of Vision Ray Tracer
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
mr.art <mr.### [at] gci net> 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}}}
It's not the same thing.
My idea was that if the ray shot from the first pixel doesn't hit
anything, then the first pixel of the image is taken, and so on. This
regardless of the position of the camera.
--
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
You could use one of the text positioning macros that I have seen
posted here. Just use the same math to place a plane or sphere segment
in the camera direction of view (camera normal?) and then put your image
on that. Everywhere you look, the image would be sure to follow.
Nieminen Juha wrote:
>
> mr.art <mr.### [at] gci net> 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}}}
>
> It's not the same thing.
> My idea was that if the ray shot from the first pixel doesn't hit
> anything, then the first pixel of the image is taken, and so on. This
> regardless of the position of the camera.
>
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
--
Mr. Art
"Often the appearance of reality is more important
than the reality of the appearance."
Bill DeWitt 2000
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3875c1c9@news.povray.org> , Nieminen Juha
<war### [at] punarastas cs tut fi> 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.
Yes, for 3.5?
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
This can be done using image maps... see my site:
http://www.angelfire.com/md2/castlewrks/
While my use wasn't explicitely backgrounds, the technique can be used in
that fashion.
My own personal interest is in being able to build multiple image maps of
background terrain and plant materials that would be impossible to model
with the memory constraints current imposed by POVRAY.
Regards,
Robert J Becraft
aka cas### [at] aol com
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <387600c5@news.povray.org>, "Robert J Becraft"
<cas### [at] aol com> wrote:
> My own personal interest is in being able to build multiple image maps of
> background terrain and plant materials that would be impossible to model
> with the memory constraints current imposed by POVRAY.
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.
--
Chris Huff
e-mail: chr### [at] yahoo com
Web page: http://chrishuff.dhs.org/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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] primenet com
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3875c1c9@news.povray.org>, Nieminen Juha
<war### [at] punarastas cs tut fi> 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] yahoo com
Web page: http://chrishuff.dhs.org/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <38764c04@news.povray.org>, "AC" <amb### [at] telia com> 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] yahoo com
Web page: http://chrishuff.dhs.org/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <387624A9.770C0A88@ida.utb.hb.se>, Mikael Carneholm
<sa9### [at] ida utb hb se> 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] yahoo com
Web page: http://chrishuff.dhs.org/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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] spiritone com
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ooops... the code was adapted from John VanSickle, not Peter Popov. Sorry for the
mistaked credit.
J
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Fri, 7 Jan 2000 09:52:38 -0700, "Paul Vanukoff"
<van### [at] primenet com> wrote:
>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 ...
How will it deal with perspective distortion?
Instead, render you picture with an alpha channel and a background
color close to or the same as the predominating color in the image you
want to use as background. Then use image_map and layered textures and
an orthographic camera to put the backdrop image behind it.
Peter Popov
pet### [at] usa net
ICQ: 15002700
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Fri, 07 Jan 2000 16:26:52 -0800, Josh English
<eng### [at] spiritone com> wrote:
>Ooops... the code was adapted from John VanSickle, not Peter Popov. Sorry for the
>mistaked credit.
>
>J
I was about to mention it :) I think I asked for help and John stepped
up but I might not remember correctly (my memory is showing glitches
since I stopped drinking coffee).
Peter Popov
pet### [at] usa net
ICQ: 15002700
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Lance Birch <lan### [at] usa net> wrote:
: 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?
Do you call _that_ simple?
--
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Paul Vanukoff <van### [at] primenet com> wrote:
: 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 ...
How would it work with an ultra_wide_angle or a fisheye camera?
--
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> Lance Birch <lan### [at] usa net> wrote:
> : 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?
>
> Do you call _that_ simple?
It is for me...
Of course if this were MAX I'd just set it up with a background set as
Screen mode with a bitmap mapping type and load the piccy... ;) hehehe
Seriously though I shouldn't be that difficult to add this kind of
functionality to POV-Ray (not that I could do it, but I'm sure someone with
some good C knowledge could)
--
Lance.
The Zone - http://come.to/the.zone
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> My idea was that if the ray shot from the first pixel doesn't hit
> anything, then the first pixel of the image is taken, and so on. This
> regardless of the position of the camera.
Sounds like an application for a RenderMan imager shader. Groan.
Unfortunately, I don't think POV-Ray has anything like that.
Sounds like you'll have to composite post-render to get that
effect.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
My memory shows glitches even when drinking coffee.
Peter Popov wrote:
> (my memory is showing glitches since I stopped drinking coffee)
>
> Peter Popov
> pet### [at] usa net
> ICQ: 15002700
--
Mr. Art
"Often the appearance of reality is more important
than the reality of the appearance."
Bill DeWitt 2000
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
My apologies... Machine memory constraints as imposed by the way POVRAY uses
the memory in a machine.
It would be nice to have an infinite resource platform to perform POVRAY
tracing on. Unfortunately, financially speaking, very few of us do.
Chris Huff wrote in message ...
>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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"mr.art" wrote:
>
> My memory shows glitches even when drinking coffee.
memory? whats that?
i wonder what this button does *click* >message sent.
--
//Spider -- [ spider@bahnhof.se ]-[ http://darkmere.wanfear.com/ ]
And the devil in black dress watches over
My guardian angel walks away
Life is short and love is always over in the morning
Black wind come carry me far away
--"Sisters of Mercy" -- "Temple Of Love"
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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.
If you're using default perspective camera you can use the sky_sphere
together with my Illusion Include File.
It will basically map the image on the sky_sphere but while a normal
image_map applied to the spherical sky_sphere would be distorted, the
Illusion Include File prevents this.
It's available at http://rsj.mobilixnet.dk/3d/illusion/illusion.html
Greetings,
Rune
---
Updated December 22: http://rsj.mobilixnet.dk
Containing 3D images, stereograms, tutorials,
The POV Desktop Theme, 350+ raytracing jokes,
miscellaneous other things, and a lot of fun!
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |