|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi,
What's the easiest way to display a 2D image, like a phtograph hanging on a
wall. I've tried something like
box {
< 10, 20, 5 >
< 10, 22, 7 >
pigment {
image_map {jpeg "puppy.jpg"}
scale 2
}
}
but the box shows gibberish.
Thanks in advance!
Pahidla
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Pahidla wrote:
> Hi,
>
> What's the easiest way to display a 2D image, like a phtograph hanging on a
> wall. I've tried something like
>
> box {
> < 10, 20, 5 >
> < 10, 22, 7 >
> pigment {
> image_map {jpeg "puppy.jpg"}
> scale 2
> }
> }
>
> but the box shows gibberish.
>
> Thanks in advance!
>
> Pahidla
>
>
By default, the image is mapped onto the x-y-plane. The image is
projected onto the object as though there were a slide projector
somewhere in the -z-direction. The image exactly fills the square area
from (x,y) coordinates (0,0) to (1,1) regardless of the image's original
size in pixels.
What is mostly done is something like this:
box {
< 0, 0, 0 >
< 1, 1, 1 >
pigment {
image_map {jpeg "puppy.jpg"}
}
scale 2
rotate (if needed)
translate (if needed)
}
Have Fun!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thanks!
Is there such a thing as a "rectangle", rather than a "box"?
Thanks again!
Pahidla
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
web.46ef777c6a46897c3ccd3f470@news.povray.org...
> Thanks!
>
> Is there such a thing as a "rectangle", rather than a "box"?
just scale your box (after the pigment has been applied)to fit your image
ratio
Say for a 800x600 image
//Camera to fit your wish of z up, y forward
camera {
location < 0, -12, 0>
sky z
up z
right x* 1.33
angle 7
look_at < 0, 0, 0>
}
//
// ******* L I G H T S *******
//
light_source {
<0.0, 0.0, 0.0>
color rgb <1.000, 1.000, 1.000>
photons {
}
translate <0, -15, 0>
}
#declare Image =
texture
{
pigment {image_map{jpeg "Your_image.jpg"}}
finish {diffuse 0.8}
}
box {
0, 1
texture {Image}
translate<-.5,-.5,-.5>// to center the box around 0rigin
scale <1.333, 1.0, 0.01> //to fit image ratio (800/600 almost = 1.333)
// you can multiply by the amount you want, like : scale <1.333, 1.0,
0.01>*10
rotate 90.0*x //to face camera
}
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
46ef8524$1@news.povray.org...
> scale <1.333, 1.0, 0.01> //to fit image ratio (800/600 almost = 1.333)
Even better
scale<Your_image_width / You_image_height, 1, 0.01> //replace
"Your_image_width" by the actual width of you image , same for the height
Marc
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Is there such a thing as a "rectangle", rather than a "box"?
There's polygons.
polygon {
4,
<0, 0>, <0, 1>, <1, 1>, <1, 0>
texture {
pigment { image_map { png "plasma2.png" } }
finish { ambient 1 diffuse 0 }
}
//scale and rotate as needed here
}
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Pahidla" <dol### [at] yahoocom> wrote in message
news:web.46ef777c6a46897c3ccd3f470@news.povray.org...
> Thanks!
>
> Is there such a thing as a "rectangle", rather than a "box"?
there are polygons, and triangles. If I want to create a rectangle, I use
this macro:
#macro Quad(P1,P2,P3,P4)
triangle {P1,P2,P3} triangle {P1,P3,P4}
#end
(you'll have to put this inside a mesh, like this:
mesh {
Quad(<0,0,0>,<0,1,0>,<1,1,0>,<1,0,0>)
}
You could even add uv-coordinates, like this: (untested code!!!)
#macro Quad(P1,P2,P3,P4)
triangle {P1,P2,P3 uv_vectors <0,0>,<0,1>,<1,1>}
triangle {P1,P3,P4 uv_vectors <0,0>,<1,1>,<1,0>}
#end
mesh {
Quad(<0,0,0>,<0,1,0>,<1,1,0>,<1,0,0>)
texture {
uv_mapping pigment {image_map {jpeg "puppy.jpg" interpolate 2}}
finish {ambient 0 diffuse 1}
}
}
cu!
--
#macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
#end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
_(0x+y.5+y/2x)_(0x-y.5+y/2x) // ZK http://www.povplace.com
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|