|
![](/i/fill.gif) |
> Wasn't it Paul Bourke who wrote:
> >How does one do a cross dissolve between two image based textures
> >based upon the clock variable say.
> Use an average texture_map, with the weights of each texture derived
> from the clock variable, something like this
> texture {
> average texture_map {
> [1-clock texture00]
> [clock texture01]
> }
> }
Thanks, seems to work a treat.
FYI, I'm putting together an animation flying through the latest release of
the 6dF galaxy survey, 3D positions of 100000 galaxies in the southern
hemisphere. At the start of the animation I will fade from plain soft edge
white representations of the galaxies to sexy textureed versions
(all aligned with the camera view direction). Near the end of the
animation when we're back out of the southern hemisphere I will
transition back to white blobs.
Now I currently have perhaps 35 high resolution textures, texture00
is the white blob for the start and end. The textures will be randomly
scaled and rotated to avoid the appearance of duplicates. I've posted
a midframe example to povray.binaries.images with the subject heading 6dF,
this is one from from a fast (hopefully dramatic) flight of abut 2000
frames....oh yes, it will in stereoscopic3D as well.
My question now is how can I automate this texture handling without the
tedious in the way I'm doing it now, just repeating each declaration.
In the end I hope to have "hundreds" of textures.
So I will have one of these for each texture
#declare texture01 = texture { pigment { image_map { tga "textures/tex01.tga" once } }
finish { texfinish } }
#declare texture02 = texture { pigment { image_map { tga "textures/tex02.tga" once } }
finish { texfinish } }
:
:
etc, 35 times
Then
#declare TRANS1 = 0.0;
#declare TRANS2 = 0.2;
#declare TRANS3 = 0.8;
#declare TRANS4 = 1.0;
#declare texturemap01 = texture {
#switch (clock)
#range (TRANS1,TRANS2)
average texture_map {
[ 1-(clock-TRANS1)/(TRANS2-TRANS1) texture00 ]
[ (clock-TRANS1)/(TRANS2-TRANS1) texture01 ]
}
#break
#range (TRANS3,TRANS4)
average texture_map {
[ (clock-TRANS3)/(TRANS4-TRANS3) texture00 ]
[ 1-(clock-TRANS3)/(TRANS4-TRANS3) texture01 ]
}
#break
#else
texture01
#break
#end
}
--
Paul Bourke
pdb(NOSPAM)swin.edu.au
Post a reply to this message
|
![](/i/fill.gif) |