POV-Ray : Newsgroups : povray.general : problems to render a script : Re: problems to render a script Server Time
1 Aug 2024 18:29:11 EDT (-0400)
  Re: problems to render a script  
From: Mike Williams
Date: 29 Jun 2005 11:27:22
Message: <2cbuoDAT3rwCFwlI@econym.demon.co.uk>
Wasn't it khayyam who wrote:
>hello everybody,
>
>I try to render the stones brickes from
>http://www-public.tu-bs.de:8080/~y0013390/pov/wtunnel.html
>the source code is here
>http://www-public.tu-bs.de:8080/~y0013390/pov/wtunnel/wt_stb.pov
>
>and with and without MegaPov, the parsing stops at the line
> #local fnBox = function { "superellipsoid", <Round,Round> }
>
>with the error "Expected 'valid function expression', < found instead"
>
>and I dont see why it doesn't work. could anyone say me what's wrong ?


To render this code as supplied, make sure you're using a version of
MegaPOV that's below v1.0 because the function syntax changed completely
at that point. When isosurfaces were introduced into official POV, the
syntax was significantly different (more powerful and flexible) from
that used in MegaPOV v0.*.

MegaPOV v1.0 adopted the new syntax.


To get it to work in the current official POV and current MegaPOV you
need to:-

Add     #include "functions.inc"

Change  #local fnBox = function { "superellipsoid", <Round, Round> }
To      #local fnBox = function { f_superellipsoid(x,y,z,Round, Round) }

Change  function { fnBox(x/(Xsz*0.5), y/(Ysz*0.5), z/(Zsz*0.5)) -
        fnNoise((x+DX), (y+DY), (z+DZ)) }
To      function { - fnBox(x/(Xsz*0.5), y/(Ysz*0.5), z/(Zsz*0.5)) +
        fnNoise((x+DX), (y+DY), (z+DZ)).hf }

Delete  sign -1
Delete  method 2

1. The syntax of functions is different
2. There is no "sign" keyword, so you have to negate the function 
   equation.
3. Pigment functions in official POV return a colour instead of a float, 
   so the ".hf" is added to extract the same float that MegaPOV 0.* 
   would have.
4. There is no "method" keyword. There's only one isosurface solver 
   method, so it's not required.


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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