POV-Ray : Newsgroups : povray.newusers : wrapping textures around an object : Re: wrapping textures around an object Server Time
30 Jul 2024 12:32:42 EDT (-0400)
  Re: wrapping textures around an object  
From: Chris B
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.