POV-Ray : Newsgroups : povray.advanced-users : Modeling a Brain with Povray Server Time
29 Jul 2024 08:15:35 EDT (-0400)
  Modeling a Brain with Povray (Message 11 to 14 of 14)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: fidel viegas
Subject: Re: Modeling a Brain with Povray
Date: 10 Jan 2003 18:26:30
Message: <3E1F551B.1030500@nodomain.com>
Tom Melly wrote:
> "fidel viegas" <fid### [at] nodomaincom> wrote in message
> news:3E1### [at] nodomaincom...
> 
>>Hello guys, I was wondering if any of you have attempted to model a
>>brain with povray.
>>How would you go about creating such a complex structure?
>>
>>Thanks in advance
>>
>>Fidel.
>>
> 
> 
> I played around with doing this (for a brain coral).
> 
> Wouldn't do if the brain was the main component of the scene, but might be a
> help if it's just a few of 'em in jars on a backshelf or something...
> 
> #include "functions.inc"
> 
> #declare F_1 = function(x,y,z){(pow(x,2)+pow(y,2)+pow(z,2)) +
> f_ridged_mf(x*10,y*10,z*10,1,1,1,1,0,3)/5 - 2}
> #declare Brain1 =
> isosurface {
>   function {F_1(x,y,z)}
>   max_gradient 20
>   contained_by {box {-5,5}}
>   pigment { rgb<0.7,0.5,0.5> }
> }
> object{Brain1}
> 

Hi Tom, thanks a lot for the source. I'll play around with it. I didn't 
know isosurfaces were so cool. I had a look at them yesterday all day 
and found a couple of tutorials on how to do volume rendering and I am 
quite amazed with it.

By the way, here is another link on df3 files: 
http://astronomy.swin.edu.au/~pbourke/povray/df3/

Thank you all

All the best

Fidel.


Post a reply to this message

From: fidel viegas
Subject: Re: Modeling a Brain with Povray
Date: 10 Jan 2003 18:29:20
Message: <3E1F55C4.1030500@nodomain.com>
fidel viegas wrote:


> I also read this on the documentation. Now I came across another program 
> called df3maker and it takes text version of the data and outputs the 
> binary version. I know how to create the binary file, but I have a doubt 
> regarding its format. I found the data below at the df3maker web site:
> 
> 4,3,5
> 0,50,50,0
> 50,100,100,50
> 0,50,50,0
> 10,100,100,10
> 100,200,200,100
> 10,100,100,10
> 50,150,150,50
> 150,255,255,150
> 50,150,150,50
> 10,100,100,10
> 100,200,200,100
> 10,100,100,10
> 0,50,50,0
> 50,100,100,50
> 0,50,50,0
> 
> Ok, I understand the 4, 3 and 5, which are the dimensions of the cube in 
> x, y and z respectively. My question is how do we come up with the data 
> values? In the docs it had x*y*z, does it mean that each cell is the 
> result of multiplying x, y and z? For instance the second value 50, is 
> it the result of this multiplication?
> 
> Another question is regarding the tga2df3 converter. How does the 2D 
> grid of pixels found in a tga picture translate to a 3D grid?

Hello guys, it's me again.

The link http://astronomy.swin.edu.au/~pbourke/povray/df3/ uses other 
formula other than x*y*z in the source code he provides. That's why I 
came up with that question regarding the generation of the data.

All the best

Fidel.


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Modeling a Brain with Povray
Date: 10 Jan 2003 22:05:02
Message: <web.3e1f88708dd3ec78b417814a0@news.povray.org>
fidel viegas wrote:
>
>ingo wrote:
>> in news:3E1### [at] nodomaincom fidel viegas wrote:
>>
>>
>>>Is there a good tutorial on how to
>>>process df3 files?
>>
>>
>> No, but there is a tga2df3 convertor at http://www.users.on.net/pod/df3/
>
>Thanks for the link. I've looked into it already.
>
>>>And what about its format?
>> See 6.7.11.11  Density_File
>
>I also read this on the documentation. Now I came across another program
>called df3maker and it takes text version of the data and outputs the
>binary version. I know how to create the binary file, but I have a doubt
>regarding its format. I found the data below at the df3maker web site:
>
>4,3,5
>0,50,50,0
>50,100,100,50
>0,50,50,0
>10,100,100,10
>100,200,200,100
>10,100,100,10
>50,150,150,50
>150,255,255,150
>50,150,150,50
>10,100,100,10
>100,200,200,100
>10,100,100,10
>0,50,50,0
>50,100,100,50
>0,50,50,0
>
>Ok, I understand the 4, 3 and 5, which are the dimensions of the cube in
>x, y and z respectively. My question is how do we come up with the data
>values? In the docs it had x*y*z, does it mean that each cell is the
>result of multiplying x, y and z? For instance the second value 50, is
>it the result of this multiplication?
......

I would guess (without knowing anything about
the text/file format for df3maker) that the
data in the text above is organized like this:

#declare Densities =
array [5][3][4] {
  {
    {   0,  50,  50,   0 },
    {  50, 100, 100,  50 },
    {   0,  50,  50,   0 }
  },
  {
    {  10, 100, 100,  10 },
    { 100, 200, 200, 100 },
    {  10, 100, 100,  10 }
  },
  {
    {  50, 150, 150,  50 },
    { 150, 255, 255, 150 },
    {  50, 150, 150,  50 }
  },
  {
    {  10, 100, 100,  10 },
    { 100, 200, 200, 100 },
    {  10, 100, 100,  10 }
  },
  {
    {   0,  50,  50,   0 },
    {  50, 100, 100,  50 },
    {   0,  50,  50,   0 }
  }
}

(I use POV syntax, because we all
know it.)

This would mean that the density
within the "cell" with coordinates
x = 0, y = 1 and z = 2 is:

Densities[2][1][0] = 150

(The value 4*3*5= 60 would be the
number of "cells" in the cube, and
therefore the number of densities
in your list above.)

But remember that I'm just guessing.


>Another question is regarding the tga2df3 converter. How does the 2D
>grid of pixels found in a tga picture translate to a 3D grid?

This program operates on several TGA-
pictures to make one single density
file.

Each TGA-picture represents a cut(?)
through the object. And the light-
ness/darkness in the pictures repre-
sents the denisity in the corre-
sponding region (or "cell").

So the Width and Height dimensions
(number of pixels in each direction)
of the TGA-pictures represents the
width and height of the cube con-
taining the object. The number of
TGA-pictures represents the depth of
the cube.

Each picture represents a layer of
"cells". The number of cells that
each represents is Width*Height.

And the total number of "cells" that
all the TGA pictures represents is
Width*Height*NrOfPictures.


So if you were to produce a density
file for a brain, you would need many
pictures, each of a different cut of
a real brain.


Tor Olav


Post a reply to this message

From: fidel viegas
Subject: Re: Modeling a Brain with Povray
Date: 11 Jan 2003 08:33:51
Message: <3E201BB4.7030703@nodomain.com>
Tor Olav Kristensen wrote:

>>I also read this on the documentation. Now I came across another program
>>called df3maker and it takes text version of the data and outputs the
>>binary version. I know how to create the binary file, but I have a doubt
>>regarding its format. I found the data below at the df3maker web site:
>>
>>4,3,5
>>0,50,50,0
>>50,100,100,50
>>0,50,50,0
>>10,100,100,10
>>100,200,200,100
>>10,100,100,10
>>50,150,150,50
>>150,255,255,150
>>50,150,150,50
>>10,100,100,10
>>100,200,200,100
>>10,100,100,10
>>0,50,50,0
>>50,100,100,50
>>0,50,50,0
>>
>>Ok, I understand the 4, 3 and 5, which are the dimensions of the cube in
>>x, y and z respectively. My question is how do we come up with the data
>>values? In the docs it had x*y*z, does it mean that each cell is the
>>result of multiplying x, y and z? For instance the second value 50, is
>>it the result of this multiplication?
> 
> ......
> 
> I would guess (without knowing anything about
> the text/file format for df3maker)

The format is the one shown above.

>that the
> data in the text above is organized like this:
> 
> #declare Densities =
> array [5][3][4] {
>   {
>     {   0,  50,  50,   0 },
>     {  50, 100, 100,  50 },
>     {   0,  50,  50,   0 }
>   },
>   {
>     {  10, 100, 100,  10 },
>     { 100, 200, 200, 100 },
>     {  10, 100, 100,  10 }
>   },
>   {
>     {  50, 150, 150,  50 },
>     { 150, 255, 255, 150 },
>     {  50, 150, 150,  50 }
>   },
>   {
>     {  10, 100, 100,  10 },
>     { 100, 200, 200, 100 },
>     {  10, 100, 100,  10 }
>   },
>   {
>     {   0,  50,  50,   0 },
>     {  50, 100, 100,  50 },
>     {   0,  50,  50,   0 }
>   }
> }
> 
> (I use POV syntax, because we all
> know it.)

> This would mean that the density
> within the "cell" with coordinates
> x = 0, y = 1 and z = 2 is:
> 
> Densities[2][1][0] = 150
> 
> (The value 4*3*5= 60 would be the
> number of "cells" in the cube, and
> therefore the number of densities
> in your list above.)

Hi Tor, thanks for your reply. I was having the array the other way 
round. that is densities[x][y][z]. You are right as I was looking at the 
source code of df3maker and that is how it reads the values from the file.

Now, my understanding of the cube is that we have a collection of xy 
planes for each value of z. Is that correct?

In the docs also says that the size of the cube will always be unit, 
which means that it doesn't matter the dimensions found in the df3 files 
because they all are going to be scaled to a value between 0 and 1, right?

I also read MegaPov 0.6 docs which says that it can generate df3 files.
Also that it supports 16 bits data as well as 8 bits, right? Is it still 
available on MegaPov 1.0? Anyone?


Now one last question. How does the rendering actually work? I mean is 
it similar to heightfields where the higher the value the higher its 
height? Is it how it works?


>>Another question is regarding the tga2df3 converter. How does the 2D
>>grid of pixels found in a tga picture translate to a 3D grid?
> 
> 
> This program operates on several TGA-
> pictures to make one single density
> file.
> 
> Each TGA-picture represents a cut(?)
> through the object. And the light-
> ness/darkness in the pictures repre-
> sents the denisity in the corre-
> sponding region (or "cell").
> 
> So the Width and Height dimensions
> (number of pixels in each direction)
> of the TGA-pictures represents the
> width and height of the cube con-
> taining the object. The number of
> TGA-pictures represents the depth of
> the cube.
> 
> Each picture represents a layer of
> "cells". The number of cells that
> each represents is Width*Height.
> 
> And the total number of "cells" that
> all the TGA pictures represents is
> Width*Height*NrOfPictures.
> 
> 
> So if you were to produce a density
> file for a brain, you would need many
> pictures, each of a different cut of
> a real brain.

This one is pretty clear now. Thanks for the explanation. This is what I 
was talking about above. The pictures are the xy planes which correspond 
to each value of z.
When I downloaded the software I thought that we would use a single 
image just like heightfields. That's why I was wondering how can we 
translate the values of a xy plane to a cube.

Anyway, you guys have been very helpful.

Thanks a lot.

All the best

Fidel.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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