POV-Ray : Newsgroups : povray.advanced-users : Macros acting strange : Re: Macros acting strange Server Time
2 Nov 2024 05:18:49 EDT (-0400)
  Re: Macros acting strange  
From: Tor Olav Kristensen
Date: 28 Mar 2000 16:51:21
Message: <38E12832.F9273777@online.no>
Hei igjen.

Tor Olav Kristensen wrote:

> (If you omit the parenthesis, then Var1 is promoted to
> a vector before it's added to a vector.)

This part of the expression would also have been
promoted to a vector if you hadn't passed 0 for the
second argument (X1) to the macro:

(Y2-Y1)/(X2-X1)*X1


> Sigmund Kyrre Aas wrote:
> ...
>  // this one adds var1*x
> ...

It actually adds var1*(x + y + z)
(or <var1, var1, var1>)

Tor Olav

mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html

Btw.: Here's a slightly simpler macro to do the same:

#macro intp(X,X1,Y1,X2,Y2)
    ((Y2-Y1)/(X2-X1)*(X-X1)+Y1)
#end


Post a reply to this message

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