POV-Ray : Newsgroups : povray.newusers : Image maps Server Time
29 Jul 2024 04:22:47 EDT (-0400)
  Image maps (Message 1 to 6 of 6)  
From: David Instone
Subject: Image maps
Date: 15 Dec 2006 01:39:36
Message: <45824328@news.povray.org>
I am trying to apply an image to the surface of a box as so

box { <-2, -0.5, -2>, <2, 0.55, 2>
       pigment{image_map {sys "Test.bmp"} scale 1}
       rotate y*45
       translate<-25.5, 0, -25.5>
   }

But I am getting a series of verticle bars. Thinking this was due to a
scaling problem I have added the scale and gone from 0.0001 to 10000. At
extremes I get a solid color that might be a corner of the image but nothing
else. Is there any way to work out how to scale the file to fit the box
surface or am I going about this completely the wrong way. I really only
want to place an image on the surface.

Thanks


Post a reply to this message

From: Chris B
Subject: Re: Image maps
Date: 15 Dec 2006 03:57:10
Message: <45826366$1@news.povray.org>
"David Instone" <d.i### [at] gmailcom> wrote in message 
news:45824328@news.povray.org...
>I am trying to apply an image to the surface of a box as so
>
> box { <-2, -0.5, -2>, <2, 0.55, 2>
>       pigment{image_map {sys "Test.bmp"} scale 1}
>       rotate y*45
>       translate<-25.5, 0, -25.5>
>   }
>
> But I am getting a series of verticle bars. Thinking this was due to a
> scaling problem I have added the scale and gone from 0.0001 to 10000. At
> extremes I get a solid color that might be a corner of the image but 
> nothing
> else. Is there any way to work out how to scale the file to fit the box
> surface or am I going about this completely the wrong way. I really only
> want to place an image on the surface.
>
> Thanks
>

My guess is that you're projecting the image onto the edge of your box and 
the lines are the continuation of the image through the box.
The image is projected onto an XY plane by default, so if you are looking at 
the XZ plane of the box you would just get stripes.

If this is your problem, just try rotating the image:

  pigment{image_map {sys "Test.bmp"} scale 1 rotate x*90}

Which should place the image on the XZ plane, then you can rotate and 
translate the box to wherever you want.

Regards,
Chris B.


Post a reply to this message

From: Chris B
Subject: Re: Image maps
Date: 15 Dec 2006 04:01:30
Message: <4582646a$1@news.povray.org>
"Chris B" <c_b### [at] btconnectcomnospam> wrote in message 
news:45826366$1@news.povray.org...
>
> "David Instone" <d.i### [at] gmailcom> wrote in message 
> news:45824328@news.povray.org...
>> Is there any way to work out how to scale the file to fit the box
>> surface or am I going about this completely the wrong way. I really only
>> want to place an image on the surface.
>>
>> Thanks
>>

Oh yes, and the scaling bit - By default the image takes up one unit square 
with it's bottom left corner at the origin. So to scale to a 4x4 surface and 
centre it you'd need

pigment{image_map {sys "Test.bmp"} scale 4 translate <-2,0,-2> rotate x*90}

Regards,
Chris B.


Post a reply to this message

From: David Instone
Subject: Re: Image maps
Date: 15 Dec 2006 05:00:09
Message: <45827229@news.povray.org>
"Chris B" <c_b### [at] btconnectcomnospam> wrote in message
news:4582646a$1@news.povray.org...
>
> Oh yes, and the scaling bit - By default the image takes up one unit
square
> with it's bottom left corner at the origin. So to scale to a 4x4 surface
and
> centre it you'd need
>
> pigment{image_map {sys "Test.bmp"} scale 4 translate <-2,0,-2> rotate
x*90}
>
> Regards,
> Chris B.
>
>

Thank you very much Chris. You hit the nail right on the head with that one
and it has been annoying me for too long. I did have to play with it a bit
to get it right though. Instead of your version I ended up with this.

pigment{image_map {sys "Test.bmp"} scale 4 rotate x*90 translate <-2,0,-2>}

I found that if you translate before you rotate you end up with two half
images tiled verticaly. Does that sound feasible or am I making it up as I
go along?

Regards David


Post a reply to this message

From: Stephen
Subject: Re: Image maps
Date: 15 Dec 2006 05:55:00
Message: <web.45827ef11ec1b08bf1cb1e660@news.povray.org>
"David Instone" <d.i### [at] gmailcom> wrote:
> "Chris B" <c_b### [at] btconnectcomnospam> wrote in message
> news:4582646a$1@news.povray.org...
> >
> > Oh yes, and the scaling bit - By default the image takes up one unit
> square
> > with it's bottom left corner at the origin. So to scale to a 4x4 surface
> and
> > centre it you'd need
> >
> > pigment{image_map {sys "Test.bmp"} scale 4 translate <-2,0,-2> rotate
> x*90}
> >
> > Regards,
> > Chris B.
> >
> >
>
> Thank you very much Chris. You hit the nail right on the head with that one
> and it has been annoying me for too long. I did have to play with it a bit
> to get it right though. Instead of your version I ended up with this.
>
> pigment{image_map {sys "Test.bmp"} scale 4 rotate x*90 translate <-2,0,-2>}
>
> I found that if you translate before you rotate you end up with two half
> images tiled verticaly. Does that sound feasible or am I making it up as I
> go along?
>
> Regards David


pigment{image_map {sys "Test.bmp"} once scale 4 rotate x*90 translate
<-2,0,-2>}

Stephen


Post a reply to this message

From: Chris B
Subject: Re: Image maps
Date: 15 Dec 2006 05:58:10
Message: <45827fc2@news.povray.org>
"David Instone" <d.i### [at] gmailcom> wrote in message 
news:45827229@news.povray.org...
>
> You hit the nail right on the head with that one
> and it has been annoying me for too long. I did have to play with it a bit
> to get it right though. Instead of your version I ended up with this.
>
> pigment{image_map {sys "Test.bmp"} scale 4 rotate x*90 translate 
> <-2,0,-2>}
>
> I found that if you translate before you rotate you end up with two half
> images tiled verticaly. Does that sound feasible or am I making it up as I
> go along?
>

Hi David,

Ah yes, of course you're perfectly correct. If you translate it first the 
translation in the Z direction has no effect, because it's just effectively 
pushing the image into itself.

So you could translate <-2,-2,0> and then rotate x*90, but I think that 
doing the rotate first, as you've done it, is clearer.

Regards,
Chris B.


Post a reply to this message

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