POV-Ray : Newsgroups : povray.programming : change all textures : change all textures Server Time
26 Jun 2024 16:13:56 EDT (-0400)
  change all textures  
From: Rafal 'Raf256' Maj
Date: 9 Jan 2005 15:54:17
Message: <Xns95D9DEEECAA0Eraf256com@203.29.75.35>
Hi,
I would like to write small patch - that will change all materials in a 
given object (see also my question in newusers 
Message-ID: <Xns95D941FDFD3F8raf256com@203.29.75.35>)

I have complex object like:

#declare TheObject=
union {
  sphere { ... material{...} }
  sphere { ... material{...} }
  union { 
     box { ... material... }
     box { ... material... }
  }
}

and now I would like to discard all pervious materials/textures from all 
objects inside TheObject, and apply to entire object some given material.

I need to do it in a program, not manualy change the code of "TheObject" 
(since TheObject is produced by external program and it would be a 
problem).

I would like to have syntax like:

object { 
  MyObject
  forget_previous_materials
  material { pigment { rgb 1 } } 
}

or

object { 
  MyObject
  force_material { pigment { rgb 1 } } 
}


I think that keyword should result in function walking entire tree of given 
object (all it-s subojbects, down to all primitives, and replace pointers 
to materials in all of them to point to a new texture).

Where should I start? Is there some tutorial for povray programming? 

Resulting code will be donated to PovRAY.
  

-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

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