POV-Ray : Newsgroups : povray.newusers : nb:question about functions : Re: nb:question about functions Server Time
5 Nov 2024 05:20:47 EST (-0500)
  Re: nb:question about functions  
From: Christoph Hormann
Date: 29 May 2002 17:26:45
Message: <3CF54795.70D1055F@gmx.de>
Petra Mueller wrote:
> 
> Hallo,
> 
> a Parse-Error is produced at the call of these
> function examples with Pov3.5.
> 
> # declare MyTorus = function for {"torus" < 1, 0.3 >}
> # declare MySphere = function {"sphere" < 1 >}
> isosurface { function {MyTorus (x, y, z), & MySphere (x, y +0.5, z)}
> 
> # declare MyTorus = { function "torus" < < ---- ERROR
> Parse Error: Expected 'operand' < found instead
> 
> Isn't this syntax supported by POV3.5?

This is no valid code, not even for megapov.  Have a look at the
documentation and the sample scenes for correct declaration of functions
and use in isosurfaces.

You probably want something like:

#include "functions.inc"

#declare MySphere = function { f_sphere(x, y, z, 1) }
#declare MyTorus = function { f_torus(x, y, z, 1, 0.3) }

isosurface { function { min(MyTorus(x, y, z), MySphere(x, y +0.5, z)) }


Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 05 May. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

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