POV-Ray : Newsgroups : povray.general : Strange parsing error : Re: Strange parsing error Server Time
2 May 2024 02:14:35 EDT (-0400)
  Re: Strange parsing error  
From: clipka
Date: 30 Sep 2017 19:09:06
Message: <59d02412$1@news.povray.org>
Am 30.09.2017 um 17:44 schrieb kurtz le pirate:

> I have an old MegaPov 1.21 code :
> 
>  93 : #macro lineEquation (rIndex, lIndex, pA, pB)
>  94 :   #local det = pA.x-pB.x;
>  95 :   #if(det=0)
>  96 :     // #error
>  97 :     #local sidesLines[rIndex][lIndex] = <0,0,1>;
>  98 :  #else
>  99 :    #local det_a = pA.z-pB.z;
> 100 :    #local det_b = (pA.x*pB.z)-(pA.z*pB.x);
> 101 :    #declare sidesLines[rIndex][lIndex] = <det_a/det,det_b/det, 0>;
> 102 :   #end
> 103 : #end
> 
> 
> Parse with PovRay 3.7 i get this error :
>     Line 99 : Bad operands for period operator.
> 
> For me, line #94 and #99 are similar, and no error for line 94.
> 
> I would also like to specify that the parameters of the macro are :
> scalar, scalar, point, point.

I'm with Alain on this one: My guess is that there's nothing wrong with
the macro per se, but rather with its invocation, and that you're
accidently passing a 2D point or scalar as the 3rd or 4th parameter. The
`.x` works fine for either of those (you can interpret a scalar as a 1D
vector if you will), but `.y` requires at least a 2D vector, and `.z`
requires at least a 3D vector.


Post a reply to this message

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