POV-Ray : Newsgroups : povray.general : save hf pattern ? : Re: save hf pattern ? Server Time
5 Aug 2024 18:20:21 EDT (-0400)
  Re: save hf pattern ?  
From: Rafal 'Raf256' Maj
Date: 30 Sep 2002 22:21:28
Message: <Xns929A2C1AEF42Braf256com@204.213.191.226>
"Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote in
news:Xns### [at] 204213191226 

> 3. sin(x)*3.0+0.1+y+z+rand(777)            // constants - ready
> now show me formula that will result in _differnet_ pattern and that
> will give _same_ hash as "sin(x)*3.0+0.1+y+z+rand(777)"

oook... problem is with
a) rand() stream state
b) variables used in functions used in expression
c) global settings, i.e. noise generator type

analysing all functions etc is possible but quite complex - maybe later... 
but even now VERY EASY work around is possible - in small steps

1. POV will just ignore problem with variables - it will not 'detect' 
change of pattern - yes then caching will work wrong, but this would be 
just a beta-test version

2. inform POV with variables are used in expression (that are not obvious - 
they are used in functions used in formula)
  pattern 1000,1000 { x+y+function_basing_on_my_variable(x,y,z)
    cache { depend(my_variable, another_var) }
  }
cache implementation is simply - just write (in .id hash file) 
  variable-name  variable-value
i.e.:
my_variable 10.0
another_var 0.33

this code (hash checking) I can write myself (but I will need some help 
with merging it with POV).

3. maybe later POV will have some more complex code to egzaminate (and 
maybe optimize) expressions ? Then, btw. we can add posibbility to auto-
detect depend variables (as they will be any way detect as it is needed to 
create optmization of pattern formula)    	

-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

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