POV-Ray : Newsgroups : povray.newusers : Simple Repeating Material definition : Simple Repeating Material definition Server Time
5 Sep 2024 04:18:09 EDT (-0400)
  Simple Repeating Material definition  
From: Jong
Date: 28 Nov 2001 22:44:55
Message: <3c05af37$1@news.povray.org>
Dear all,

 I have imported POV file from a Rhino3D modeller file, which contain a lot
of cylinder-like objects, say 50 of them. Actually, I have given the objects
the same material property. But the imported objects have separate almost
identical -- except for the number identifiers--statements of the material.
I'd like to simplify them.
My simple thought was :

#declare ObjectCommonMaterial= material {
  something_I_want
  }
#declare Object1Material = ObjectCommonMaterial;
.... (repeating #declares here)
....
#declare Object49Material= ObjectCommonMaterial;
#declare Object50Material= ObjectCommonMaterial;

However, I know this is not an elegant way to do the work, since I might
have for example two hundreds more of the same objects.

I wish you could help me in this regard.
Thanks in advance,

Jong

// Partial copy of the scene file --
// Object1
 --- deleted --
// Object49
#declare Object49Material = material {
texture {
  pigment { color rgbf <0, 0.478431, 1, 0.85> }
  finish  { ambient 1 diffuse 1 phong 1 phong_size 191 }
  }
}
#declare Object49 = object {
   #include "Cylinder_49.inc"
}
object { Object49 material { Object49Material }}


// Object50
#declare Object50Material = material {
texture {
  pigment { color rgbf <0, 0.478431, 1, 0.85> }
  finish  { ambient 1 diffuse 1 phong 1 phong_size 191 }
  }
}
#declare Object50 = object {
   #include "Cylinder_50.inc"
}
object { Object50 material { Object50Material }}

--- end of the file --


Post a reply to this message

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