POV-Ray : Newsgroups : povray.newusers : newbie question : Re: newbie question Server Time
6 Sep 2024 14:17:12 EDT (-0400)
  Re: newbie question  
From: Eric Pascual
Date: 2 Feb 1998 18:46:54
Message: <34d667e8.0@news.povray.org>
Hello Ian

As you have guessed, the solution uses #declare. You can define an abject as
follows :

#declare Object_Foo = object {
... a lot of statements to create you object here ...
}

then use it by writing :

// a yellow foo object located at  <0, 100, 0>
object {
  Object_Foo
  pigment {
    color Yellow
  }
  translate <0, 100, 0>
}

// now a red one located at <100, 0, 0> and rotated a bit
object {
  Object_Foo
  pigment {
    color Red
  }
  rotate z*30
  translate <100, 0, 0>
}

To replicate a lot of objects on a regular basis, you can use the loop
statements, so that creating a theater with all its seats will not require
10,000 lines of POV source code but just a small amount of looping code :-)

I have not validated this snippet but I have written stuff similar to it,
and it works.

Hope this will help
Eric


Post a reply to this message

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