![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Hey all,
I've been goofing around with .df3 files and stumbled onto a neat effect. To
create the attached image, I included a tree (generic one from POV-Tree)
and used the trace() function to probe the surface of the tree and output
intersection coordinates to the command line. A python script processed the
intersection points into a .df3 file. In a second .pov file, I included the
.df3 as the density in a media section to create the ghost tree on the
right while the original tree is on the left.
Mike K
--
http://povray.tashcorp.net
Post a reply to this message
Attachments:
Download 'trunk.png' (183 KB)
Preview of image 'trunk.png'
![trunk.png](/povray.binaries.images/attachment/%3C42f8fd10%40news.povray.org%3E/trunk.png?ttop=441697&toff=5050&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Mike Kost <con### [at] povray tashcorp net> wrote:
> Hey all,
>
> I've been goofing around with .df3 files and stumbled onto a neat effect. To
> create the attached image, I included a tree (generic one from POV-Tree)
> and used the trace() function to probe the surface of the tree and output
> intersection coordinates to the command line. A python script processed the
> intersection points into a .df3 file. In a second .pov file, I included the
> .df3 as the density in a media section to create the ghost tree on the
> right while the original tree is on the left.
>
> Mike K
> --
> http://povray.tashcorp.net
Super-Cool effect! I am doing something rather similiar to generate clouds
with .df3 (the media in my last "Armillary" post uses a .df3.) I wish
there was a way to generate binary files directly from POV - maybe there is
and I have just missed it. What I need is POV's excellent random number
generators. Right now I have to output the random stream to an ascii file,
read that file into my BASIC program, and then write out the .df3. A file
made of a cube of 1000^3 two byte integers is big enough, but in comma
separated ascii it's immense! I can't use the BASIC random generator
because I get those nasty plateaus.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Lonnie wrote:
> Mike Kost <con### [at] povray tashcorp net> wrote:
>> Hey all,
>>
>> I've been goofing around with .df3 files and stumbled onto a neat effect.
>> To create the attached image, I included a tree (generic one from
>> POV-Tree) and used the trace() function to probe the surface of the tree
>> and output intersection coordinates to the command line. A python script
>> processed the intersection points into a .df3 file. In a second .pov
>> file, I included the .df3 as the density in a media section to create the
>> ghost tree on the right while the original tree is on the left.
>>
>> Mike K
>> --
>> http://povray.tashcorp.net
>
> Super-Cool effect! I am doing something rather similiar to generate
> clouds
> with .df3 (the media in my last "Armillary" post uses a .df3.) I wish
> there was a way to generate binary files directly from POV - maybe there
> is
> and I have just missed it. What I need is POV's excellent random number
> generators. Right now I have to output the random stream to an ascii
> file,
> read that file into my BASIC program, and then write out the .df3. A file
> made of a cube of 1000^3 two byte integers is big enough, but in comma
> separated ascii it's immense! I can't use the BASIC random generator
> because I get those nasty plateaus.
Since I can't remember what you're processing into the .df3 besides
randomness, take with a grain of salt, but ... why don't you take advantage
of POV's noise functions? Import the large variations via a .df3 file into
a function
#declare f_data3d = function {
pattern {
density_file df3 "my.df3"
interpolate 2
}
}
Then combine this function with f_noise3d to get the variation
#declare f_final3d = function { f_data3d(x,y,z) + 0.01 *
f_noise3d(x,y,z) }
Then use this as a function into the density statement
media {
... media settings here ...
density {
function { f_final3d(x,y,z) }
color_map { ... }
}
}
If you go that route, you should be able to get the general shape using a
smaller .df3 and use Povray to add small, random variations that are
expensive to capture in .df3 files.
Mike
--
http://povray.tashcorp.net
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Thanks Mike - I had just hit on that idea when you posted. I had been
reading through Mike Williams' tutorial on isosurfaces (I am modeling
flowstone) and saw that .df3 files could be used as a pattern function for
them as well. Almost any function could be mapped, not just random
numbers.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Lonnie" <lon### [at] yahoo com> wrote:
> and I have just missed it. What I need is POV's excellent random number
> generators. Right now I have to output the random stream to an ascii file,
> read that file into my BASIC program, and then write out the .df3.
Judging from your use of BASIC, I suppose you don't run Linux. However,
if you have a linux box somewhere near you, you can get pretty good
random values from the kernel entropy pool.
From the command line (resolution is two bytes in this example):
dd if=/dev/urandom bs=2 count=1 2>/dev/null | hexdump -d |grep "0000000" |
awk '{print $2/65536}'
Or with some C (resolution is four bytes):
//
// this method returns a random value between 0 and 1
//
double getrnd(int rdev, void** datar);
double getrnd(int rdev, void** datar) {
ssize_t bytesread = read(rdev, datar, 4);
unsigned long rint = (unsigned long)(*datar);
double rval = (double)rint/4294967296.;
return rval;
}
int main(int argc, char **argv) {
// open the kernel entropy pool
int rndev = open("/dev/urandom", O_RDONLY);
void* rdata[4];
double x = getrnd(rndev,rdata);
close(rndev);
}
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Mike Kost" <con### [at] povray tashcorp net> wrote in message
news:42f8fd10@news.povray.org...
> Hey all,
>
> I've been goofing around with .df3 files and stumbled onto a neat effect.
To
> create the attached image, I included a tree (generic one from POV-Tree)
> and used the trace() function to probe the surface of the tree and output
> intersection coordinates to the command line. A python script processed
the
> intersection points into a .df3 file. In a second .pov file, I included
the
> .df3 as the density in a media section to create the ghost tree on the
> right while the original tree is on the left.
>
> Mike K
> --
> http://povray.tashcorp.net
>
i was wondering if you could also use photons on an object to get "ghost"
effects. have an object that a lot of photons land on, render with saving
photons to file. then render again, removing the object but loading the
photon file.
just a thought. i havn't tried it yet.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> Judging from your use of BASIC, I suppose you don't run Linux. However,
> if you have a linux box somewhere near you, you can get pretty good
> random values from the kernel entropy pool.
Right now looking into Python's pseudo-random number generators - they
should do quite nicely.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |