POV-Ray : Newsgroups : povray.general : The Language of POV-Ray : Re: The Language of POV-Ray Server Time
11 Aug 2024 03:25:22 EDT (-0400)
  Re: The Language of POV-Ray  
From: Chris Huff
Date: 11 Mar 2000 11:12:16
Message: <chrishuff_99-6D2517.11140511032000@news.povray.org>
In article <38CA66D7.9E1F957C@pacbell.net>, lin### [at] povrayorg 
wrote:

> To me the first example is more intuitive. Where does Move come from ?
> 
> I don't like the idea that I would have to make a macro just to move an
> object. Seems like extra work to me. Point still not conceded.

Who said the macro was required? You could still redeclare and translate 
it if you wanted, you just would have a harder time keeping track of 
things.
Say you have a long string of objects that are linked together. You move 
one, and it affects all the others. You can calculate the positions and 
transformations for all of them(maybe enclosing the whole thing in a 
macro), or you can have each one be manipulated by a macro and only call 
the base macro. A macro and variable would be attached by doing 
something like this:
object {
    #local DistanceMoved = 0;
    #macro Move(Direction)
        translate Direction
        #local DistanceMoved = DistanceMoved + vlength(Direction);
        // or this... :-)
        #local DistanceMoved += vlength(Direction);
    #end
}

To do something like this without OO features, you would have to make a 
special macro and set of variables for each object, separated only by a 
unique name.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

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