POV-Ray : Newsgroups : povray.newusers : wrapping textures around an object Server Time
2 Nov 2024 13:17:54 EDT (-0400)
  wrapping textures around an object (Message 1 to 5 of 5)  
From: Tim
Subject: wrapping textures around an object
Date: 12 Apr 2004 01:54:29
Message: <407a2f15@news.povray.org>
whenever i use image_map to map a texture onto a box of any size, only the
front and back is textured leaving the top and sides all wierd and stretched
looking ... (the texture bricks is just declared becasue i use it often in
my scene)

#declare bricks = texture {
 pigment {
  image_map {
   "stone.bmp"
      map_type 0
      interpolate 2
  }
  scale 10
 }
}

box {
 <-20, -10, 5>, <20, 2.7, 10>
 texture { bricks }
}

.. i just want the brick texture to show up everywhere on the box.
help appreciated


Post a reply to this message

From: JC (Exether)
Subject: Re: wrapping textures around an object
Date: 12 Apr 2004 03:58:30
Message: <407a4c26$1@news.povray.org>
Tim wrote:

> whenever i use image_map to map a texture onto a box of any size, only the
> front and back is textured leaving the top and sides all wierd and stretched
> looking ... (the texture bricks is just declared becasue i use it often in
> my scene)
> 
> #declare bricks = texture {
>  pigment {
>   image_map {
>    "stone.bmp"
>       map_type 0
>       interpolate 2
>   }
>   scale 10
>  }
> }
> 
> box {
>  <-20, -10, 5>, <20, 2.7, 10>
>  texture { bricks }
> }
> 
> .. i just want the brick texture to show up everywhere on the box.
> help appreciated

POV textures are 3D textures, which means they have a value in every 
point of space.
Quote from POV documentation:
" 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."

So when you create a texture with an image map, it can be seen only on 
planes in the (x,y) direction, on other planes the streched parts you 
see are the borders of the image.

If you want to use your texture on the box, you will have to create 
separately the 6 faces and assigning the texture to them with proper 
rotations.

I hope that helps,

JC

-- 
http://exether.free.fr/irtc (more IRTC stats !)


Post a reply to this message

From: Florian Brucker
Subject: Re: wrapping textures around an object
Date: 12 Apr 2004 05:50:50
Message: <407a667a@news.povray.org>
> If you want to use your texture on the box, you will have to create 
> separately the 6 faces and assigning the texture to them with proper 
> rotations.

If the object supports it (which is the case with a box), you can also 
use uv_mapping. See the documentation, section 6.7.7 (which can be found 
online at http://www.povray.org/documentation/view/191/).

HTH,
Florian


Post a reply to this message

From: Tim
Subject: Re: wrapping textures around an object
Date: 12 Apr 2004 16:40:16
Message: <407afeb0@news.povray.org>
"Florian Brucker" <tor### [at] torfboldcom> wrote in message
news:407a667a@news.povray.org...
> > If you want to use your texture on the box, you will have to create
> > separately the 6 faces and assigning the texture to them with proper
> > rotations.
>
> If the object supports it (which is the case with a box), you can also
> use uv_mapping. See the documentation, section 6.7.7 (which can be found
> online at http://www.povray.org/documentation/view/191/).
>
> HTH,
> Florian
>

well this works, but now the sizes of the texture differ from side to side
(top of the box shows the texture with the right sizing, but the side of the
box has the texture all stretched) by using differnt scaling i can sorta
make them close to the same, but theres gotta be a better way to do this?


Post a reply to this message

From: Chris B
Subject: Re: wrapping textures around an object
Date: 12 Apr 2004 18:00:54
Message: <407b1196$1@news.povray.org>
"JC (Exether)" <no### [at] spamfr> wrote in message
news:407a4c26$1@news.povray.org...
> Tim wrote:
>
> > whenever i use image_map to map a texture onto a box of any size, only
the
> > front and back is textured leaving the top and sides all wierd and
stretched
> > looking ... (the texture bricks is just declared becasue i use it often
in
> > my scene)
> >
> > #declare bricks = texture {
> >  pigment {
> >   image_map {
> >    "stone.bmp"
> >       map_type 0
> >       interpolate 2
> >   }
> >   scale 10
> >  }
> > }
> >
> > box {
> >  <-20, -10, 5>, <20, 2.7, 10>
> >  texture { bricks }
> > }
> >
> > .. i just want the brick texture to show up everywhere on the box.
> > help appreciated
>
> POV textures are 3D textures, which means they have a value in every
> point of space.
> Quote from POV documentation:
> " 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."
>
> So when you create a texture with an image map, it can be seen only on
> planes in the (x,y) direction, on other planes the streched parts you
> see are the borders of the image.
>
> If you want to use your texture on the box, you will have to create
> separately the 6 faces and assigning the texture to them with proper
> rotations.
>
> I hope that helps,
>
> JC
>
> -- 
> http://exether.free.fr/irtc (more IRTC stats !)

You could cut that to three by declaring your box and having 3 almost
identical, but differently scaled copies with the texture rotated on each
copy.
I moved your box a little so it stradles the origin (so that when it scales
it gets a tiny bit bigger in both the positive and negative direction).

#declare wall = box {<-20, -10, -2.5>, <20, 2.7, 2.5>}

object {wall scale <1,1,1.0001> texture { bricks}}
object {wall scale <1.0001,1,1> texture { bricks rotate y*90}}
object {wall scale <1,1.0001,1> texture { bricks rotate x*90}}

Any good?


Post a reply to this message

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