POV-Ray : Newsgroups : povray.newusers : texture positioning problem Server Time
1 Nov 2024 11:16:50 EDT (-0400)
  texture positioning problem (Message 1 to 3 of 3)  
From: Xayvion
Subject: texture positioning problem
Date: 22 Sep 2005 07:40:01
Message: <web.4332975e3364fc7fe1ee334e0@news.povray.org>
Hi all

I have a problem with pov-ray.  I'm trying to make a keyboard button with a
letter in the upper left corner, but I can't find a way how to position the
texture on the correct place on the button.  The image file "D.png" is
simply a transparent png with the letter "D" in it. I'm using Pov-ray
3.6.1a for Windows.

This is the script i'm using.  Can someone please help me?

Thanks

Xayvion

#include "colors.inc"    // The include files contain
#include "stones.inc"    // pre-defined scene elements

#declare btnColor = pigment {color Yellow}
#declare mapD = pigment { image_map {png "D.png" once} }
#declare tex = texture {btnColor} texture {mapD}

background { color Cyan }
  camera {
    location <0, 3, -4>
    look_at  <0, 0,  0>
    up <0,1,0>
  }


 prism {
    //linear_sweep
    conic_sweep
    cubic_spline
    0.75, // sweep the following shape from here ...
    1, // ... up through here
    7, // the number of points making up the shape ...
    <1,-1>,<-1,-1>,<-1,1>,<1,1>,<1,-1>,<-1,-1>,<-1,1>
    texture { tex }
    rotate <180, 0, 0>
    translate <0, 1, 0>
    scale <1,3,1>

  }

  light_source { <0, 10, 0> color White}


Post a reply to this message

From: Chris B
Subject: Re: texture positioning problem
Date: 22 Sep 2005 11:52:16
Message: <4332d330$1@news.povray.org>
"Xayvion" <nomail@nomail> wrote in message 
news:web.4332975e3364fc7fe1ee334e0@news.povray.org...
> Hi all
>
> I have a problem with pov-ray.  I'm trying to make a keyboard button with 
> a
> letter in the upper left corner, but I can't find a way how to position 
> the
> texture on the correct place on the button.  The image file "D.png" is
> simply a transparent png with the letter "D" in it. I'm using Pov-ray
> 3.6.1a for Windows.
>
> This is the script i'm using.  Can someone please help me?
>
> Thanks
>
> Xayvion
>
> #include "colors.inc"    // The include files contain
> #include "stones.inc"    // pre-defined scene elements
>
> #declare btnColor = pigment {color Yellow}
> #declare mapD = pigment { image_map {png "D.png" once} }
> #declare tex = texture {btnColor} texture {mapD}
>
> background { color Cyan }
>  camera {
>    location <0, 3, -4>
>    look_at  <0, 0,  0>
>    up <0,1,0>
>  }
>
>
> prism {
>    //linear_sweep
>    conic_sweep
>    cubic_spline
>    0.75, // sweep the following shape from here ...
>    1, // ... up through here
>    7, // the number of points making up the shape ...
>    <1,-1>,<-1,-1>,<-1,1>,<1,1>,<1,-1>,<-1,-1>,<-1,1>
>    texture { tex }
>    rotate <180, 0, 0>
>    translate <0, 1, 0>
>    scale <1,3,1>
>
>  }
>
>  light_source { <0, 10, 0> color White}
>
>
>

Hi Xayvion,

You can transpose the pigment in the same way you transpose objects, so if 
you change your pigment declaration to:

#declare mapD = pigment { image_map {png "D.png" once} scale 0.5 translate 
<-0.8,0,0.8> rotate -x*90  }

it gets scaled, translated and rotated and should end up more or less 
wherever you want.

Have fun,

Chris B.


Post a reply to this message

From: Xayvion
Subject: Re: texture positioning problem
Date: 23 Sep 2005 06:50:00
Message: <web.4333ddb78600c26de1ee334e0@news.povray.org>
"Chris B" <c_b### [at] btconnectcomnospam> wrote:
> "Xayvion" <nomail@nomail> wrote in message
> news:web.4332975e3364fc7fe1ee334e0@news.povray.org...
> > Hi all
> >
> > I have a problem with pov-ray.  I'm trying to make a keyboard button with
> > a
> > letter in the upper left corner, but I can't find a way how to position
> > the
> > texture on the correct place on the button.  The image file "D.png" is
> > simply a transparent png with the letter "D" in it. I'm using Pov-ray
> > 3.6.1a for Windows.
> >
> > This is the script i'm using.  Can someone please help me?
> >
> > Thanks
> >
> > Xayvion
> >
> > #include "colors.inc"    // The include files contain
> > #include "stones.inc"    // pre-defined scene elements
> >
> > #declare btnColor = pigment {color Yellow}
> > #declare mapD = pigment { image_map {png "D.png" once} }
> > #declare tex = texture {btnColor} texture {mapD}
> >
> > background { color Cyan }
> >  camera {
> >    location <0, 3, -4>
> >    look_at  <0, 0,  0>
> >    up <0,1,0>
> >  }
> >
> >
> > prism {
> >    //linear_sweep
> >    conic_sweep
> >    cubic_spline
> >    0.75, // sweep the following shape from here ...
> >    1, // ... up through here
> >    7, // the number of points making up the shape ...
> >    <1,-1>,<-1,-1>,<-1,1>,<1,1>,<1,-1>,<-1,-1>,<-1,1>
> >    texture { tex }
> >    rotate <180, 0, 0>
> >    translate <0, 1, 0>
> >    scale <1,3,1>
> >
> >  }
> >
> >  light_source { <0, 10, 0> color White}
> >
> >
> >
>
> Hi Xayvion,
>
> You can transpose the pigment in the same way you transpose objects, so if
> you change your pigment declaration to:
>
> #declare mapD = pigment { image_map {png "D.png" once} scale 0.5 translate
> <-0.8,0,0.8> rotate -x*90  }
>
> it gets scaled, translated and rotated and should end up more or less
> wherever you want.
>
> Have fun,
>
> Chris B.

Hi Chris

Thanks, that is exactly what I was looking for.

Xayvion


Post a reply to this message

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