POV-Ray : Newsgroups : povray.general : Mapping images on to prisms Server Time
4 Nov 2024 19:20:54 EST (-0500)
  Mapping images on to prisms (Message 1 to 6 of 6)  
From: Mike Varley
Subject: Mapping images on to prisms
Date: 28 Jan 1999 15:33:33
Message: <36B0C996.175C3DC2@nacstock.ac.uk>
Hi

I'm trying to map an image on to the 'end' of a prism but no matter what
I do it always maps onto the 'side' of it. Basically I'm trying to
create a 7 sided coin with an image mapped on the 'heads' and 'tails'
side. This is what I've tried:

prism {
  linear_sweep
  linear_spline
  -0.9, 0.9,  7,
< 0.623, 0>, < 0, 0.782>, < 0.223, 1.757>, < 1.123,  2.19>, < 2.023,
1.757>, <2.246, 0.782>, <1.623, 0>

pigment{
      image_map {
                 gif "50p_tails.gif"
                 once
                 }
               scale <2.46, 2, 0>
              }
}

Any ideas?

Mike Varley
mik### [at] nacstockacuk


Post a reply to this message

From: Josh English
Subject: Re: Mapping images on to prisms
Date: 28 Jan 1999 16:14:09
Message: <36B0D3F6.4330D7B@spiritone.com>
Yes, this will happen. Image maps will move forever through the z axis, the
once option only applies to the x-y plane. In order to place an image map on
the other side, you need to make two objects with the same height and width
but with half the depth, then on the second one place the second image but
be sure to rotate it correctly or it will appear backwards.

Josh English
eng### [at] spiritonecom

Mike Varley wrote:

> Hi
>
> I'm trying to map an image on to the 'end' of a prism but no matter what
> I do it always maps onto the 'side' of it. Basically I'm trying to
> create a 7 sided coin with an image mapped on the 'heads' and 'tails'
> side. This is what I've tried:
>
> prism {
>   linear_sweep
>   linear_spline
>   -0.9, 0.9,  7,
> < 0.623, 0>, < 0, 0.782>, < 0.223, 1.757>, < 1.123,  2.19>, < 2.023,
> 1.757>, <2.246, 0.782>, <1.623, 0>
>
> pigment{
>       image_map {
>                  gif "50p_tails.gif"
>                  once
>                  }
>                scale <2.46, 2, 0>
>               }
> }
>
> Any ideas?
>
> Mike Varley
> mik### [at] nacstockacuk


Post a reply to this message

From: Ron Parker
Subject: Re: Mapping images on to prisms
Date: 28 Jan 1999 16:31:15
Message: <36b0d723.0@news.povray.org>
On Thu, 28 Jan 1999 13:17:42 -0800, Josh English <eng### [at] spiritonecom> wrote:
>Yes, this will happen. Image maps will move forever through the z axis, the
>once option only applies to the x-y plane. In order to place an image map on
>the other side, you need to make two objects with the same height and width
>but with half the depth, then on the second one place the second image but
>be sure to rotate it correctly or it will appear backwards.

You might also try some trickery with the radial pattern:

  #macro DoubleImage( front, back ) 
    radial
    pigment_map {
      [.5 front]
      [.5 back rotate 180*y]
    }
  #end
 
  #declare f=pigment{image_map{ sys "heads.bmp" once } translate -.5}
  #declare b=pigment{image_map{ sys "tails.bmp" once } translate -.5}
 
  #declare coin=cylinder {
    -.1*z,.1*z,1 
    texture{pigment {color rgb 1}} 
    texture {pigment {DoubleImage(f,b)}}
  }

If you look at the front (-z) side of this simple round coin, you'll see 
the heads image.  Look at the back (z) side and you see the tails image.


Post a reply to this message

From: PoD
Subject: Re: Mapping images on to prisms
Date: 28 Jan 1999 17:07:31
Message: <36B0DFA3.C7D@merlin.net.au>
> 
> Hi
> 
> I'm trying to map an image on to the 'end' of a prism but no matter what
> I do it always maps onto the 'side' of it. Basically I'm trying to
> create a 7 sided coin with an image mapped on the 'heads' and 'tails'
> side. This is what I've tried:
>
 
Image maps project the image onto the x,y plane while prisms are created
in the x,z plane,
just rotate your prism around the x axis

> prism {
>   linear_sweep
>   linear_spline
>   -0.9, 0.9,  7,
> < 0.623, 0>, < 0, 0.782>, < 0.223, 1.757>, < 1.123,  2.19>, < 2.023,
> 1.757>, <2.246, 0.782>, <1.623, 0>

   rotate x*-90 // ***** rotation added ********
> 
> pigment{
>       image_map {
>                  gif "50p_tails.gif"
>                  once
>                  }
>                scale <2.46, 2, 0>
>               }
> }
> 
> Any ideas?
> 
> Mike Varley
> mik### [at] nacstockacuk

Cheers, PoD.


Post a reply to this message

From: Josh English
Subject: Re: Mapping images on to prisms
Date: 29 Jan 1999 12:00:38
Message: <36B1EA22.31BA3605@spiritone.com>
Ok, so I was still thinking brute force... that is a great solution, kudos for
clever thinking.

I am working on a web site that collects this kind of specific questions, would you
mind if I used this solution for it (giving you full credit, of course)

Josh English
eng### [at] spiritonecom

Ron Parker wrote:

> On Thu, 28 Jan 1999 13:17:42 -0800, Josh English <eng### [at] spiritonecom> wrote:
> >Yes, this will happen. Image maps will move forever through the z axis, the
> >once option only applies to the x-y plane. In order to place an image map on
> >the other side, you need to make two objects with the same height and width
> >but with half the depth, then on the second one place the second image but
> >be sure to rotate it correctly or it will appear backwards.
>
> You might also try some trickery with the radial pattern:
>
>   #macro DoubleImage( front, back )
>     radial
>     pigment_map {
>       [.5 front]
>       [.5 back rotate 180*y]
>     }
>   #end
>
>   #declare f=pigment{image_map{ sys "heads.bmp" once } translate -.5}
>   #declare b=pigment{image_map{ sys "tails.bmp" once } translate -.5}
>
>   #declare coin=cylinder {
>     -.1*z,.1*z,1
>     texture{pigment {color rgb 1}}
>     texture {pigment {DoubleImage(f,b)}}
>   }
>
> If you look at the front (-z) side of this simple round coin, you'll see
> the heads image.  Look at the back (z) side and you see the tails image.


Post a reply to this message

From: Ron Parker
Subject: Re: Mapping images on to prisms
Date: 29 Jan 1999 12:12:03
Message: <36b1ebe3.0@news.povray.org>
On Fri, 29 Jan 1999 09:04:35 -0800, Josh English <eng### [at] spiritonecom> wrote:
>Ok, so I was still thinking brute force... that is a great solution, kudos for
>clever thinking.
>
>I am working on a web site that collects this kind of specific questions, would you
>mind if I used this solution for it (giving you full credit, of course)

You may, but you'll also want to give credit to Chris Colefax for his 
contribution.  His version was posted both here (in povray.newusers) 
and in CGRR, I think, and is basically the same idea but maps a 
different texture on each face of a cube. (And is thus vastly more 
complex.)


Post a reply to this message

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