POV-Ray : Newsgroups : povray.general : Did I miss anything? (parent/child texture in CSG) : Re: Did I miss anything? (parent/child texture in CSG) Server Time
10 Dec 2024 15:30:38 EST (-0500)
  Re: Did I miss anything? (parent/child texture in CSG)  
From: William F Pokorny
Date: 1 Feb 2024 00:37:47
Message: <65bb2e2b$1@news.povray.org>
On 1/31/24 08:14, Ilya Razmanov wrote:
> Any chances I can have it?

The usual way is to use the fast path texture element overrides.

//---
...
#declare Fn00 = function { pattern { spiral1 12 scale 1/6} }
#declare Fn01 = function { pattern { wrinkles scale 1/99 } }
#declare Tor00 = torus {
     0.5, 0.15
     // What follows are overrides of the default texture's
     // three components - creating a new texture for Tor00.
     pigment { White }
     normal {
         function { (Fn00(-x,y,z)+Fn01(x,y,z)*0.2)/1.2 }
         bump_size +0.67 rotate x*90
         accuracy 0.005
     }
     finish { ambient 0.0 brilliance 1.5 }
}

object { Tor00 } // White around origin.

// White on left side of image
union {
     object { Tor00 translate y*-0.7 }
     object { Tor00 translate y*+0.7 }
     pigment { Green } // Ignored where objects are textured.
     translate (x+z)*-1.25
}

// Following is a way to override just the pigment component
// of the texture already on Tor00.
union {
     object { Tor00 pigment { Green } translate y*-0.7 }
     object { Tor00 pigment { Red }   translate y*+0.7 }
     translate (x+z)*+1.25
}
...
//---

There are limitations to the approach where the texture{}s are 
non-simple (ie layered) or a material{} is used.

Bill P.


Aside: Remember how in v3.8 beta2 is spiral1 is really spiral2 due a 
typo? Well, I coded a v3.7 version for posting here after my yuqk 
version (where spiral1 is spiral1) and, dang if doesn't look like the 
rotate of the spiral has been flipped in yuqk / v3.8? relative to v3.7.
I don't think this something I did, but suppose I might have to create
a fixed version of v3.8 beta 2 to be sure...


Post a reply to this message


Attachments:
Download 'keepnormal.jpg' (51 KB)

Preview of image 'keepnormal.jpg'
keepnormal.jpg


 

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