POV-Ray : Newsgroups : povray.general : Converting function syntax to 3.5 Server Time
17 Nov 2024 17:19:22 EST (-0500)
  Converting function syntax to 3.5 (Message 1 to 3 of 3)  
From: Xplo Eristotle
Subject: Converting function syntax to 3.5
Date: 30 Jan 2003 19:14:39
Message: <3e39bfef@news.povray.org>
So I've got this scene written for MegaPOV 0.7 with the following code 
in it:

#declare worldnet5 = function
   {
   pigment
     {
     marble
     color_map
       {
       [ 0.0 color rgb 0 ]
       [ 1.0 color rgb 1 ]
       }
     rotate <0, 0, 90>
     }
   }

#declare worldnet7 = function { pigment { radial frequency 48 turbulence 
4 } }

#declare worldnet9 = function { (min(worldnet7+.9, worldnet5) * 
(worldnet7 * worldnet5)^3) * 100 }

...and I was trying to make it work in POV-Ray 3.5. Well, changing the 
power operator to pow() was a no brainer, but it kept giving me parsing 
errors for worldnet9, no matter how I tried to fix it. Finally I gave up 
and looked through the documentation to see exactly what was going 
wrong. The documentation is far from easy reading, but the impression 
that I got was that what I'm trying to do may not be possible at all.

As far as I'm concerned, whoever changed functions for 3.5 butchered a 
perfectly good syntax.. but that's not the point, the point is, *is* it 
possible to write this function in 3.5, and if so, how should it look?

-Xplo


Post a reply to this message

From: Mike Williams
Subject: Re: Converting function syntax to 3.5
Date: 30 Jan 2003 23:44:05
Message: <FUtWaKAF7fO+Ewgl@econym.demon.co.uk>
Wasn't it Xplo Eristotle who wrote:
>So I've got this scene written for MegaPOV 0.7 with the following code 
>in it:
>
>#declare worldnet5 = function
>   {
>   pigment
>     {
>     marble
>     color_map
>       {
>       [ 0.0 color rgb 0 ]
>       [ 1.0 color rgb 1 ]
>       }
>     rotate <0, 0, 90>
>     }
>   }
>
>#declare worldnet7 = function { pigment { radial frequency 48 turbulence 
>4 } }
>
>#declare worldnet9 = function { (min(worldnet7+.9, worldnet5) * 
>(worldnet7 * worldnet5)^3) * 100 }
>
>...and I was trying to make it work in POV-Ray 3.5. Well, changing the 
>power operator to pow() was a no brainer, but it kept giving me parsing 
>errors for worldnet9, no matter how I tried to fix it. Finally I gave up 
>and looked through the documentation to see exactly what was going 
>wrong. The documentation is far from easy reading, but the impression 
>that I got was that what I'm trying to do may not be possible at all.
>
>As far as I'm concerned, whoever changed functions for 3.5 butchered a 
>perfectly good syntax.. but that's not the point, the point is, *is* it 
>possible to write this function in 3.5, and if so, how should it look?
>
>-Xplo
>

The syntax is

#declare worldnet9 = function { (min(worldnet7(x,y,z).grey+.9,
worldnet5(x,y,z).grey) * pow((worldnet7(x,y,z).grey *
worldnet5(x,y,z).grey),3)) * 100 }

I know the syntax is slightly more complicated, but that's the price you
have to pay for the considerably increased functionality.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: fidel viegas
Subject: Re: Converting function syntax to 3.5
Date: 31 Jan 2003 08:37:55
Message: <3E3A7A8D.8010705@nodomain.com>
Xplo Eristotle wrote:
> So I've got this scene written for MegaPOV 0.7 with the following code 
> in it:
> 
> #declare worldnet5 = function
>   {
>   pigment
>     {
>     marble
>     color_map
>       {
>       [ 0.0 color rgb 0 ]
>       [ 1.0 color rgb 1 ]
>       }
>     rotate <0, 0, 90>
>     }
>   }
> 
> #declare worldnet7 = function { pigment { radial frequency 48 turbulence 
> 4 } }
> 
> #declare worldnet9 = function { (min(worldnet7+.9, worldnet5) * 
> (worldnet7 * worldnet5)^3) * 100 }
> 
> ...and I was trying to make it work in POV-Ray 3.5. Well, changing the 
> power operator to pow() was a no brainer, but it kept giving me parsing 
> errors for worldnet9, no matter how I tried to fix it. Finally I gave up 
> and looked through the documentation to see exactly what was going 
> wrong. The documentation is far from easy reading, but the impression 
> that I got was that what I'm trying to do may not be possible at all.
> 
> As far as I'm concerned, whoever changed functions for 3.5 butchered a 
> perfectly good syntax.. but that's not the point, the point is, *is* it 
> possible to write this function in 3.5, and if so, how should it look?
> 

Hello Xplo,
If you have a look at http://www.econym.demon.co.uk/isotut/index.htm you 
will find good tutorials that explains the syntax for povray 3.5

All the best

Fidel.


Post a reply to this message

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