POV-Ray : Newsgroups : povray.unofficial.patches : Trouble with MechSim fields : Re: Trouble with MechSim fields Server Time
18 Jun 2024 08:12:05 EDT (-0400)
  Re: Trouble with MechSim fields  
From: ssssmemyself
Date: 20 Aug 2004 10:05:01
Message: <web.4126030898395bf215c1769c0@news.povray.org>
Christoph Hormann <chr### [at] gmxde> wrote:
> ssssmemyself wrote:
> > [...]
> > #declare Fn_Vector = function(x,y,z) {
> >   Vector_Function(
> >     function{0}
> >     function{
> >       #if (y>RADIUS)
> >         0
> >       #else
> >         #if (y<-RADIUS)
> >           9.81*4/3
> >         #else
> >           9.81*pi*(((y-r)*r*r-1/3*pow(y-r,3))-(-r*r*r-1/3*pow(-r,3)))
> >         #end
> >       #end
> >     }
> >     function{0}
> >   )
> > }
>
> You have some basic misunderstanding of how use of #if in functions work
> - you can not do render time conditionals this way - use select() for this.
>
> --
> Christoph Hormann
> http://www.tu-bs.de/~y0013390/

Whoops! I guess the #if command works more like C precompilers then. Makes
sense, seeing how it starts with a #.


Post a reply to this message

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