POV-Ray : Newsgroups : povray.advanced-users : Local variables in a function : Local variables in a function Server Time
6 Oct 2024 13:54:12 EDT (-0400)
  Local variables in a function  
From: bugman
Date: 3 Jul 2006 05:10:00
Message: <web.44a8de03ac5178027acd794a0@news.povray.org>
I know how to create local variables in a macro, but after extensive
searching, I still have not found any way to create local variables in a
function. Is this even possible?

Just for a crazy example, suppose I had something like this:
#declare f=function(x) {sum(i,1,1000,pow(sin(x),i))}

Then it would be much faster if I could make a local variable, say,
something like this:
#declare f=function(x) {sinx=sin(x); sum(i,1,1000,pow(sinx,i))}


Post a reply to this message

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