POV-Ray : Newsgroups : povray.binaries.images : Woven Cloth Texture Server Time
31 Oct 2024 18:00:57 EDT (-0400)
  Woven Cloth Texture (Message 1 to 10 of 29)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Dave Blandston
Subject: Woven Cloth Texture
Date: 9 Feb 2010 20:20:00
Message: <web.4b72093ee292c410cba3fb0f0@news.povray.org>
In case anyone's interested, here's a handy woven cloth texture. To add color,
you can add another texture to the averaged texture_map near the end. I hope
someone finds this usefull!

Regards,
Dave Blandston

* * * * * * * * * * * * * * * * * * * * * * * *

#local ClothScale = .5;
#local ThreadWidth = .2;
#local EdgeWidth = .08;

#declare Cloth = texture {
   pigment {
      gradient x
      color_map {
         [0 color Black]
         [.1 color Black]
         [.5 color White * 4]
         [.9 color Black]
         [1 color Black]
      } //color_map
   } //pigment
} //texture
texture {
   pigment {
      gradient y
      color_map {
         [0 color Black]
         [.5 - ThreadWidth / 2 - EdgeWidth color Black]
         [.5 - ThreadWidth / 2 color Black transmit 1]
         [.5 + ThreadWidth / 2 color Black transmit 1]
         [.5 + ThreadWidth / 2 + EdgeWidth color Black]
         [1 color Black]
      } //color_map
   } //pigment
} //texture

#declare Cloth = texture {
   average
   texture_map {
      [1 Cloth]
      [1 Cloth translate <.5, .5, 0>]
      [1 Cloth rotate 90 * z translate <.5, 0, 0>]
      [1 Cloth rotate 90 * z translate <0, .5, 0>]
      //[1 MyTexture]
   } //texture_map
   scale <ClothScale, ClothScale, 1>
} //texture


Post a reply to this message


Attachments:
Download 'temp.png' (50 KB)

Preview of image 'temp.png'
temp.png


 

From: Thomas de Groot
Subject: Re: Woven Cloth Texture
Date: 10 Feb 2010 03:02:19
Message: <4b72680b$1@news.povray.org>
"Dave Blandston" <nomail@nomail> schreef in bericht 
news:web.4b72093ee292c410cba3fb0f0@news.povray.org...
> In case anyone's interested, here's a handy woven cloth texture. To add 
> color,
> you can add another texture to the averaged texture_map near the end. I 
> hope
> someone finds this usefull!
>

Thanks a lot indeed. I always use an image map for this effect, mostly as a 
bump map (as your texture can also be applied of course), but it is nice to 
have it as a texture code.

Thomas


Post a reply to this message

From: nemesis
Subject: Re: Woven Cloth Texture
Date: 10 Feb 2010 03:40:00
Message: <web.4b7270ceadaa4c5e5da2233a0@news.povray.org>
looks a lot like the one used in Gimp too.  Perhaps similar algorithms? :)


Post a reply to this message

From: Paolo Gibellini
Subject: Re: Woven Cloth Texture
Date: 10 Feb 2010 06:58:05
Message: <4b729f4d@news.povray.org>
>Dave Blandston  on date 10/02/2010 02:17 wrote:
> In case anyone's interested, here's a handy woven cloth texture. To add color,
> you can add another texture to the averaged texture_map near the end. I hope
> someone finds this usefull!
> 
> Regards,
> Dave Blandston
> 
Simple and neat solution,
;-)
Paolo


Post a reply to this message

From: Warp
Subject: Re: Woven Cloth Texture
Date: 10 Feb 2010 14:58:21
Message: <4b730fdd@news.povray.org>
Dave Blandston wrote:
> In case anyone's interested, here's a handy woven cloth texture. To add color,
> you can add another texture to the averaged texture_map near the end. I hope
> someone finds this usefull!

  I think it would be even more useful if it had a 'normal' block as
well. That way it would interact with lighting, giving it depth.


Post a reply to this message

From: Nekar Xenos
Subject: Re: Woven Cloth Texture
Date: 11 Feb 2010 05:57:31
Message: <op.u7yl1wlaufxv4h@go-dynamite>
Hmm, I could use this as a starting point fore a carbon fibre texture :)

-Nekar
On Wed, 10 Feb 2010 03:17:50 +0200, Dave Blandston <nomail@nomail> wrote:

> In case anyone's interested, here's a handy woven cloth texture. To add  
> color,
> you can add another texture to the averaged texture_map near the end. I  
> hope
> someone finds this usefull!
>
> Regards,
> Dave Blandston
>
> * * * * * * * * * * * * * * * * * * * * * * * *
>
> #local ClothScale = .5;
> #local ThreadWidth = .2;
> #local EdgeWidth = .08;
>
> #declare Cloth = texture {
>    pigment {
>       gradient x
>       color_map {
>          [0 color Black]
>          [.1 color Black]
>          [.5 color White * 4]
>          [.9 color Black]
>          [1 color Black]
>       } //color_map
>    } //pigment
> } //texture
> texture {
>    pigment {
>       gradient y
>       color_map {
>          [0 color Black]
>          [.5 - ThreadWidth / 2 - EdgeWidth color Black]
>          [.5 - ThreadWidth / 2 color Black transmit 1]
>          [.5 + ThreadWidth / 2 color Black transmit 1]
>          [.5 + ThreadWidth / 2 + EdgeWidth color Black]
>          [1 color Black]
>       } //color_map
>    } //pigment
> } //texture
>
> #declare Cloth = texture {
>    average
>    texture_map {
>       [1 Cloth]
>       [1 Cloth translate <.5, .5, 0>]
>       [1 Cloth rotate 90 * z translate <.5, 0, 0>]
>       [1 Cloth rotate 90 * z translate <0, .5, 0>]
>       //[1 MyTexture]
>    } //texture_map
>    scale <ClothScale, ClothScale, 1>
> } //texture


-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


Post a reply to this message

From: Warp
Subject: Re: Woven Cloth Texture
Date: 11 Feb 2010 12:24:17
Message: <4b743d41$1@news.povray.org>
Warp wrote:
>   I think it would be even more useful if it had a 'normal' block as
> well. That way it would interact with lighting, giving it depth.

  I tried to do this myself, but didn't get anything useful. Maybe it's
harder than it sounds.


Post a reply to this message

From: Captain Jack
Subject: Re: Woven Cloth Texture
Date: 11 Feb 2010 15:34:27
Message: <4b7469d3@news.povray.org>
"Dave Blandston" <nomail@nomail> wrote in message 
news:web.4b72093ee292c410cba3fb0f0@news.povray.org...

> In case anyone's interested, here's a handy woven cloth texture. To add 
> color,
> you can add another texture to the averaged texture_map near the end. I 
> hope
> someone finds this usefull!

I tried adding a little turbulence the texture pattern, rendering once in 
gray and again with a colored pattern, then imported the gray as a height 
field and the pattern as the color, and made a pretty neat shape. I made 
real gaps in the shape with the water level. I think you could do a pretty 
good picnic basket or some such by UV mapping this output as a displacement 
map, too.

Bravo, I like this. :-)

--
Jack


Post a reply to this message

From: Anthony D  Baye
Subject: Re: Woven Cloth Texture
Date: 12 Feb 2010 12:45:22
Message: <4b7593b2@news.povray.org>
Most Excellent.  I tried to come up with something similar a while back, 
but failed. This works great.

A.D.B.

Dave Blandston wrote:
> In case anyone's interested, here's a handy woven cloth texture. To add color,
> you can add another texture to the averaged texture_map near the end. I hope
> someone finds this usefull!
> 
> Regards,
> Dave Blandston
> 
> * * * * * * * * * * * * * * * * * * * * * * * *
> 
> #local ClothScale = .5;
> #local ThreadWidth = .2;
> #local EdgeWidth = .08;
> 
> #declare Cloth = texture {
>    pigment {
>       gradient x
>       color_map {
>          [0 color Black]
>          [.1 color Black]
>          [.5 color White * 4]
>          [.9 color Black]
>          [1 color Black]
>       } //color_map
>    } //pigment
> } //texture
> texture {
>    pigment {
>       gradient y
>       color_map {
>          [0 color Black]
>          [.5 - ThreadWidth / 2 - EdgeWidth color Black]
>          [.5 - ThreadWidth / 2 color Black transmit 1]
>          [.5 + ThreadWidth / 2 color Black transmit 1]
>          [.5 + ThreadWidth / 2 + EdgeWidth color Black]
>          [1 color Black]
>       } //color_map
>    } //pigment
> } //texture
> 
> #declare Cloth = texture {
>    average
>    texture_map {
>       [1 Cloth]
>       [1 Cloth translate <.5, .5, 0>]
>       [1 Cloth rotate 90 * z translate <.5, 0, 0>]
>       [1 Cloth rotate 90 * z translate <0, .5, 0>]
>       //[1 MyTexture]
>    } //texture_map
>    scale <ClothScale, ClothScale, 1>
> } //texture
> 
> 
> ------------------------------------------------------------------------
>


Post a reply to this message


Attachments:
Download '9.png' (267 KB)

Preview of image '9.png'
9.png


 

From: zutroi67
Subject: Re: Woven Cloth Texture
Date: 14 Feb 2010 05:11:20
Message: <4b77cc48$1@news.povray.org>
On 13/02/2010 4:44 AM, Anthony D. Baye wrote:
> Most Excellent.  I tried to come up with something similar a while back,
> but failed. This works great.

ha! a little 9. that's very cute.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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