|
![](/i/fill.gif) |
"PoD" <pod### [at] merlin net au> wrote in message
news:3A7E8847.C9EFB12A@merlin.net.au...
> As for the first problem, the POV parser uses normal precedence rules.
> It does the multiplication first, then the addition.
> y = <0,1,0> so y* -45 = <0,-45,0>
> then it promotes the second 45 to a vector so that it can be added
> 45 becomes <45,45,45>
> so the end result is <0,-45,0> + <45,45,45> = <45,0,45>
>
Yep, got it figured now. I'd never taken in that rotate y on its own meant
anything, so I'd misunderstood what the * in rotate y*45 meant (I vaguely
assumed it was to allow the parser to recognise a single vector
transformation).
That aside, intuitively, I would still have expected "rotate y * foo + bar"
to limit the rotations to the y axis. Still, now I know.....
All in all, it reminds me of what someone at work told me. He is an
experienced programmer and script writer, but he always uses brackets - e.g.
x := ((x*45) + 10)
When I asked him why, he said that a) he doesn't have to worry about someone
screwing up the parser, b) it makes the code clearer and c) why not?
Post a reply to this message
|
![](/i/fill.gif) |