|
![](/i/fill.gif) |
In article <38CA66D7.9E1F957C@pacbell.net>, lin### [at] povray org
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] yahoo com
Web page: http://chrishuff.dhs.org/
Post a reply to this message
|
![](/i/fill.gif) |