POV-Ray : Newsgroups : povray.binaries.images : Woven Cloth Texture : Woven Cloth Texture Server Time
31 Jul 2024 08:26:47 EDT (-0400)
  Woven Cloth Texture  
From: Dave Blandston
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


 

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