|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi!
I've got plane's wings where I want to put flags and other stuff like decals
from gif or png files...
It is possible? how?
I tried with something like this:
box
{
<0,0,0><4,4,0.1>
texture {
pigment {image_map {
png "img.png" once
}
}
}
}
with no results!
Dox
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"danyolgiax" <d.o### [at] gmailcom> wrote in message
news:web.4457760fbc052dbba8eb78fb0@news.povray.org...
> Hi!
>
> I've got plane's wings where I want to put flags and other stuff like
> decals
> from gif or png files...
>
> It is possible? how?
>
> I tried with something like this:
>
> box
> {
> <0,0,0><4,4,0.1>
> texture {
> pigment {image_map {
> png "img.png" once
> }
> }
> }
> }
>
> with no results!
>
> Dox
>
Hi Dany,
I pasted your box definition into a scene file and it worked OK for me. The
image is only one unit by one unit by default so it initially only appeared
in the bottom left quarter of your box, but it was there. Scaling the image
by 4 made it fill your 4x4 unit box.
Is it possible that the problem is somewhere else in your scene - e.g.
camera not pointing at the box , or something else blocking the cameras line
of sight?
Regards,
Chris B.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
After few tries I've resolved with this:
#declare frontlabel =
pigment { image_map { png "train.png" // the file to read
(iff/gif/tga/png/sys)
map_type 0 // 0=planar, 1=spherical, 2=cylindrical,
5=torus
interpolate 0 // 0=none, 1=linear, 2=bilinear,
4=normalized distance
once
} // image_map
translate <1.5,0.5,0>
scale <3,0,0>
translate <-4.5,-0.5,0>
}
#declare label1 =
pigment {
radial
pigment_map {
[ 0.5 rgbt 1 ]
[ 0.5 frontlabel ]
} }
box {
<0,0,0><3,1,1>
texture { pigment {color rgb <0.5,0.5,0.5>} }
texture { pigment { label1 } }
}
note that train.png is 300x100 png image!
Ok it works! but I can't understand those values:
translate <1.5,0.5,0>
scale <3,0,0>
translate <-4.5,-0.5,0>
"Chris B" <c_b### [at] btconnectcomnospam> wrote:
> "danyolgiax" <d.o### [at] gmailcom> wrote in message
> news:web.4457760fbc052dbba8eb78fb0@news.povray.org...
> > Hi!
> >
> > I've got plane's wings where I want to put flags and other stuff like
> > decals
> > from gif or png files...
> >
> > It is possible? how?
> >
> > I tried with something like this:
> >
> > box
> > {
> > <0,0,0><4,4,0.1>
> > texture {
> > pigment {image_map {
> > png "img.png" once
> > }
> > }
> > }
> > }
> >
> > with no results!
> >
> > Dox
> >
>
> Hi Dany,
>
> I pasted your box definition into a scene file and it worked OK for me. The
> image is only one unit by one unit by default so it initially only appeared
> in the bottom left quarter of your box, but it was there. Scaling the image
> by 4 made it fill your 4x4 unit box.
>
> Is it possible that the problem is somewhere else in your scene - e.g.
> camera not pointing at the box , or something else blocking the cameras line
> of sight?
>
> Regards,
> Chris B.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"danyolgiax" <d.o### [at] gmailcom> wrote in message
news:web.44586fbe319c0b1aa8eb78fb0@news.povray.org...
>
> note that train.png is 300x100 png image!
>
> Ok it works! but I can't understand those values:
>
> translate <1.5,0.5,0>
> scale <3,0,0>
> translate <-4.5,-0.5,0>
>
Hi Dany,
The two translates seem to cancel each other out and the scale factor should
be <3,1,1>.You should find a warning in the message stream to tell you that
scaling by zero is not valid and that POV-Ray has automatically substituted
'1's where you specified '0's
Despite the resolution of the image, it will always get mapped initially to
a 1 unit square with it's bottom left corner at the origin and its top
right corner at x=1,y=1. By scaling the image up by a factor of 3 in the 'x'
dimension you effectively restore the original proportions of the image.
Scaling takes place relative to the origin, so when you use translate
'<1.5,0.5,0>' you move the bottom left corner to x=1.5,y=0.5, then scaling
by x*3,y*1 puts the bottom left corner at x=4.5,y=0.5. Your second translate
therefore moves the bottom left corner back to the origin.
So, all in all these three lines do the same as just specifying:
scale <3,1,1>
Hope this helps,
Regards,
Chris B.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Yes! It helps! Thanks!
Theres a related problem... if I want to create a bump map for the same png
in texture?
in bump_map I cannot specify "scale"!!!
"Chris B" <c_b### [at] btconnectcomnospam> wrote:
> "danyolgiax" <d.o### [at] gmailcom> wrote in message
> news:web.44586fbe319c0b1aa8eb78fb0@news.povray.org...
> >
> > note that train.png is 300x100 png image!
> >
> > Ok it works! but I can't understand those values:
> >
> > translate <1.5,0.5,0>
> > scale <3,0,0>
> > translate <-4.5,-0.5,0>
> >
>
> Hi Dany,
>
> The two translates seem to cancel each other out and the scale factor should
> be <3,1,1>.You should find a warning in the message stream to tell you that
> scaling by zero is not valid and that POV-Ray has automatically substituted
> '1's where you specified '0's
>
> Despite the resolution of the image, it will always get mapped initially to
> a 1 unit square with it's bottom left corner at the origin and its top
> right corner at x=1,y=1. By scaling the image up by a factor of 3 in the 'x'
> dimension you effectively restore the original proportions of the image.
>
> Scaling takes place relative to the origin, so when you use translate
> '<1.5,0.5,0>' you move the bottom left corner to x=1.5,y=0.5, then scaling
> by x*3,y*1 puts the bottom left corner at x=4.5,y=0.5. Your second translate
> therefore moves the bottom left corner back to the origin.
>
> So, all in all these three lines do the same as just specifying:
> scale <3,1,1>
>
> Hope this helps,
>
> Regards,
> Chris B.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"danyolgiax" <d.o### [at] gmailcom> wrote in message
news:web.44588abc319c0b1aa8eb78fb0@news.povray.org...
>
> Theres a related problem... if I want to create a bump map for the same
> png
> in texture?
>
> in bump_map I cannot specify "scale"!!!
Jumping in to help here. Put the scale into the normal {}, outside of the
bump_map {}.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|