![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Good evening
I have implemented the codes belonging to the 2 and 3 messages in this
threadhttp://news.povray.org/povray.general/thread/%3Cweb.62d84daeafca4da4d8145616fb08dd02%40news.povray.org%3E/
what the codes basically do is import an image to fit the output screen.
all I want to do is overlay a line over the image that was imported into povray.
when I use povrays primitive objects they seem not to be behind the imported
image. I say this because they are not coming up at all.
so how do I make the object show over the imported image
thank you
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"6digit" <eob### [at] gmail com> wrote:
> Good evening
>
> I have implemented the codes belonging to the 2 and 3 messages in this
>
threadhttp://news.povray.org/povray.general/thread/%3Cweb.62d84daeafca4da4d8145616fb08dd02%40news.povray.org%3E/
>
> what the codes basically do is import an image to fit the output screen.
>
> all I want to do is overlay a line over the image that was imported into povray.
> when I use povrays primitive objects they seem to be behind the imported
> image. I say this because they are not coming up at all.
>
>
>
> so how do I make the object show over the imported image
> thank you
sorry had to rewrite the question
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
hi,
"6digit" <eob### [at] gmail com> wrote:
> ...
> all I want to do is overlay a line over the image that was imported into povray.
> when I use povrays primitive objects they seem not to be behind the imported
> image. I say this because they are not coming up at all.
>
> so how do I make the object show over the imported image
conceptually:
+--------------------+
| box w image_map |
+--------------------+
+--------------------+
| "box" for line(s) |
+--------------------+
-+---+-
\ / camera
*
(where I'm "looking" down the Y axis. the quoted "box" is not a primitive, but
simply to highlight the space.
if you posted a (simplified) version of your code, I/we could, likely, provide
better advice.
regards, jr.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"jr" <cre### [at] gmail com> wrote:
> ...
> conceptually:
> ...
a simple example (I did have a little time on my hands :-)):
-----<snip>-----
#version 3.7;
global_settings {assumed_gamma 1}
#declare pigment_ = pigment {
image_map {
png "tinai.png"
once
map_type 0
interpolate 2
}
scale <2.048,1.519,1>
};
#declare box_ = box {
0, <2.048,1.519,.1>
texture {
pigment {pigment_}
finish {ambient 0}
}
};
#declare line_ = cylinder {0,<2.048,0,0>,.05 no_shadow};
light_source {<-1,1,-1>*1e3 color srgb 1 parallel}
camera {
location <1,.75,-5>
right x * (4/3)
up y
angle 35
look_at <1,.75,0>
}
object {box_ translate <0,0,1>}
object {line_ pigment {color rgb x} translate <0,.5,0>}
-----<snip>-----
note that the image dimension (2048x1519) and such should all be stored in
variables, "magic numbers" in the code invariably lead to more work)
regards ,jr.
Post a reply to this message
Attachments:
Download '6digit.png' (16 KB)
Preview of image '6digit.png'
![6digit.png](/povray.general/attachment/%3Cweb.62dc4efa8506b8621be3cd4b6cde94f1%40news.povray.org%3E/6digit.png?ttop=443780&toff=150&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 23/07/2022 1:31 pm, 6digit wrote:
> Good evening
>
> I have implemented the codes belonging to the 2 and 3 messages in this
>
threadhttp://news.povray.org/povray.general/thread/%3Cweb.62d84daeafca4da4d8145616fb08dd02%40news.povray.org%3E/
>
> what the codes basically do is import an image to fit the output screen.
>
> all I want to do is overlay a line over the image that was imported into povray.
> when I use povrays primitive objects they seem not to be behind the imported
> image. I say this because they are not coming up at all.
>
>
>
> so how do I make the object show over the imported image
> thank you
>
>
ghere is mt previous anwser rotated into the x, z, plane:
/////////////////////////////////////////////////////////////////////////
#declare image_width = 2592;
#declare image_height = 1944;
// perspective (default, not required) camera
camera {
orthographic
location <image_width/2, 10000, image_height/2,>
look_at <image_width/2, 0, image_height/2>
right x*image_width/1944 // aspect
//direction<3129.6857,3102.3533,0>
focal_point < 563.2927, 0, 1366.9001>
aperture 3.6171875
// direction z // direction and zoom
angle 16 // field (overrides direction zoom)
}
box{<0,0,0>,<1,1,0.001>
pigment {image_map {"D:/Files/Photos/Historic boats/027.JPG" once
map_type 0 interpolate 2 } }
finish {ambient 1 diffuse 0}
scale <image_width, image_height, 1>
rotate<90,0,0> // Rotate into the x,z plane
}
box{<0,0,0>,<900,2,-80> // Size
pigment{rgb<1,0,1>} // Colour
finish {ambient 1 diffuse 0} // Make it visible
translate<88,1,88> // Move it about (the y*1 puts it above
the image box)
}
////////////////////////////////////////////////////////////////////////
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
It has been pointed out that "image_width" and "image_height" are
built-in POV-Ray variables.
Here is a corrected version of my answer:
>
> here is mt previous answer rotated into the x, z, plane:
>
> /////////////////////////////////////////////////////////////////////////
#declare Image_W = 2592;
#declare Image_H = 1944;
// perspective (default, not required) camera
camera {
orthographic
location <Image_W/2, 10000, Image_H/2,>
look_at <Image_W/2, 0, Image_H/2>
right x*Image_W/1944 // aspect
//direction<3129.6857,3102.3533,0>
focal_point < 563.2927, 0, 1366.9001>
aperture 3.6171875
// direction z // direction and zoom
angle 16 // field (overides direction zoom)
}
box{<0,0,0>,<1,1,0.001>
pigment {image_map {"D:/Files/Photos/Historic boats/027.JPG" once
map_type 0 interpolate 2 } }
finish {ambient 1 diffuse 0}
scale <Image_W, Image_H, 1>
rotate<90,0,0> // Rotate into the x,z plane
}
box{<0,0,0>,<900,2,-80> // Size
pigment{rgb<1,0,1>} // Colour
finish {ambient 1 diffuse 0} // Make it visible
translate<88,1,88> // Move it about (the y*1 puts it above
the image box)
}
> ////////////////////////////////////////////////////////////////////////
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 2022-07-24 05:55 (-4), m@b wrote:
> It has been pointed out that "image_width" and "image_height" are
> built-in POV-Ray variables.
>
> Here is a corrected version of my answer:
>
>>
>> here is mt previous answer rotated into the x, z, plane:
>>
>> /////////////////////////////////////////////////////////////////////////
>
>
> #declare Image_W = 2592;
> #declare Image_H = 1944;
Also, in POV-Ray 3.7 and later, you can read the dimensions directly
from the pigment:
#declare P = pigment
{ image_map
{ jpeg "D:/Files/Photos/Historic boats/027.JPG"
once map_type 0 interpolate 2
}
}
#declare Image_W = max_extent (P).x;
#declare Image_H = max_extent (P).y;
> [snip]
>
> pigment {image_map {"D:/Files/Photos/Historic boats/027.JPG" once
> map_type 0 interpolate 2 } }
> finish {ambient 1 diffuse 0}
Did you omit the #version at the top of the scene deliberately? POV-Ray
3.7 and POV-Ray 3.6 render it differently; if you include #version 3.7,
the image turns out too pale. Also, you omitted the jpeg keyword in the
image_map; POV-Ray 3.7 renders it to completion, but 3.6 halts, looking
for PNG image.
If the scene is intended for POV-Ray 3.7 or later, then the finish
statement should be:
finish {ambient 0 diffuse 0 emission 1}
This will be important if 6digit decides to use radiosity.
If the scene is intended for POV-Ray 3.6, the finish statement must
remain as you wrote it, and the image dimensions cannot be read from the
file; but the jpeg keyword needs to be included in the image_map statement.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 25/07/2022 7:01 pm, Cousin Ricky wrote:
> On 2022-07-24 05:55 (-4), m@b wrote:
>> It has been pointed out that "image_width" and "image_height" are
>> built-in POV-Ray variables.
>>
>> Here is a corrected version of my answer:
>>
>>>
>>> here is mt previous answer rotated into the x, z, plane:
>>>
>>> /////////////////////////////////////////////////////////////////////////
>>
>>
>> #declare Image_W = 2592;
>> #declare Image_H = 1944;
>
> Also, in POV-Ray 3.7 and later, you can read the dimensions directly
> from the pigment:
>
> #declare P = pigment
> { image_map
> { jpeg "D:/Files/Photos/Historic boats/027.JPG"
> once map_type 0 interpolate 2
> }
> }
> #declare Image_W = max_extent (P).x;
> #declare Image_H = max_extent (P).y;
>
That's useful, thanks.
>> [snip]
>>
>> pigment {image_map {"D:/Files/Photos/Historic boats/027.JPG" once
>> map_type 0 interpolate 2 } }
>> finish {ambient 1 diffuse 0}
>
> Did you omit the #version at the top of the scene deliberately? POV-Ray
> 3.7 and POV-Ray 3.6 render it differently; if you include #version 3.7,
> the image turns out too pale. Also, you omitted the jpeg keyword in the
> image_map; POV-Ray 3.7 renders it to completion, but 3.6 halts, looking
> for PNG image.
>
> If the scene is intended for POV-Ray 3.7 or later, then the finish
> statement should be:
> finish {ambient 0 diffuse 0 emission 1}
> This will be important if 6digit decides to use radiosity.
>
> If the scene is intended for POV-Ray 3.6, the finish statement must
> remain as you wrote it,
6digit wrote it :-)
and the image dimensions cannot be read from the
> file; but the jpeg keyword needs to be included in the image_map statement.
Good point re the jpeg keyword.
I answered as I did because I was trying to keep my answer as close to
the original question as possible. As I didn't know what version 6digit
might be using I thought is best not to include a version number
assuming he would post my code into his programme.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"m@b" <sai### [at] googlemail com> wrote:
> It has been pointed out that "image_width" and "image_height" are
> built-in POV-Ray variables.
>
> Here is a corrected version of my answer:
>
> >
> > here is mt previous answer rotated into the x, z, plane:
> >
> > /////////////////////////////////////////////////////////////////////////
>
>
> #declare Image_W = 2592;
> #declare Image_H = 1944;
>
>
> // perspective (default, not required) camera
> camera {
> orthographic
> location <Image_W/2, 10000, Image_H/2,>
> look_at <Image_W/2, 0, Image_H/2>
> right x*Image_W/1944 // aspect
> //direction<3129.6857,3102.3533,0>
> focal_point < 563.2927, 0, 1366.9001>
> aperture 3.6171875
> // direction z // direction and zoom
> angle 16 // field (overides direction zoom)
> }
>
>
> box{<0,0,0>,<1,1,0.001>
> pigment {image_map {"D:/Files/Photos/Historic boats/027.JPG" once
> map_type 0 interpolate 2 } }
> finish {ambient 1 diffuse 0}
> scale <Image_W, Image_H, 1>
> rotate<90,0,0> // Rotate into the x,z plane
> }
>
> box{<0,0,0>,<900,2,-80> // Size
> pigment{rgb<1,0,1>} // Colour
> finish {ambient 1 diffuse 0} // Make it visible
> translate<88,1,88> // Move it about (the y*1 puts it above
> the image box)
> }
>
>
>
> > ////////////////////////////////////////////////////////////////////////
Good evening im hoping any one can see this message i notice something when
scrolling through this code.
location <Image_W/2, 10000, Image_H/2,>
> look_at <Image_W/2, 0, Image_H/2>
i notice the predefined width and height were divided by 2. why ? and what does
it do exactly. thank you
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 2022-07-30 17:55 (-4), 6digit wrote:
>
> Good evening im hoping any one can see this message i notice something when
> scrolling through this code.
> location <Image_W/2, 10000, Image_H/2,>
>> look_at <Image_W/2, 0, Image_H/2>
>
> i notice the predefined width and height were divided by 2. why ? and what does
> it do exactly. thank you
Because we want the camera over the middle of the image. If we don't
divide by 2, we end up over the upper right corner.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |