POV-Ray : Newsgroups : povray.programming : Editing density structure Server Time
22 Dec 2024 21:44:45 EST (-0500)
  Editing density structure (Message 1 to 6 of 6)  
From: Maurya
Subject: Editing density structure
Date: 13 Aug 2003 18:25:01
Message: <web.3f3ab9a392153c77b248b4cf0@news.povray.org>
Hi,
The density tag can be used with the colormap to render each voxel with
a differenct color depending on the density. I want to add another
parameter like temperature to each voxel in deciding its color.

Can somebody give me some initial guidelines as to how to proceed with this
idea. I am a new developer on povray, hence I dont have much idea of the
structure of the code..

Thanks a lot,
Regards,
Maurya


Post a reply to this message

From: Thomas Willhalm
Subject: Re: Editing density structure
Date: 14 Aug 2003 09:22:58
Message: <3f3b8d31@news.povray.org>
Hello Maurya,

Maurya wrote:
> The density tag can be used with the colormap to render each voxel with
> a differenct color depending on the density. I want to add another
> parameter like temperature to each voxel in deciding its color.
> 
> Can somebody give me some initial guidelines as to how to proceed with
> this idea. I am a new developer on povray, hence I dont have much idea of
> the structure of the code..

I'm by far not an expert in POV-Ray code, so others should correct me if I'm
wrong. To the best of my knowledge, you should change the following:
- Add the necessary data types to the Media_Struct in frame.h
  (e.g. a pointer to a pigment)
- Initialize your additional data fields in Create_Media in media.cpp
- Make sure memory is freed in Destroy_Media in media.cpp (if necessary)
- Copy your data in Copy_Media in media.cpp
- Add code to parse your extension in Parse_Media in parstxtr.cpp
- If you add new tokens, declare them in parse.h and define them in   
  tokenize.cpp
- In sample_media in media.cpp the color is computed according to
  extinction, scattering, and emission. Make the changes you have in mind
  here.

Best regards
Thomas

-- 
aaa := ira


Post a reply to this message

From: ingo
Subject: Re: Editing density structure
Date: 14 Aug 2003 12:15:41
Message: <Xns93D7B9C2FB614seed7@povray.org>
in news:web.3f3ab9a392153c77b248b4cf0@news.povray.org Maurya wrote:

> Hi,
> The density tag can be used with the colormap to render each voxel
> with a differenct color depending on the density. I want to add
> another parameter like temperature to each voxel in deciding its
> color. 

Maurya

Could you tell a bit more of what your exact goal is, as I have the 
feeling that it may not be needed to patch POV-Ray but that it can be done 
in SDL directly. Read for example the help file section "6.8.3.4  Multiple 
Density vs. Multiple Media". This can give you the possibility to use one 
'density' to control the density and an other, representing a temperature 
distribution, to control the color.

Ingo


Post a reply to this message

From: Christopher James Huff
Subject: Re: Editing density structure
Date: 16 Aug 2003 21:25:40
Message: <cjameshuff-A14B5D.20224016082003@netplex.aussie.org>
In article <web.3f3ab9a392153c77b248b4cf0@news.povray.org>,
 "Maurya" <mau### [at] hotmailcom> wrote:

> The density tag can be used with the colormap to render each voxel with
> a differenct color depending on the density. I want to add another
> parameter like temperature to each voxel in deciding its color.

As described, you don't need to modify POV. Just preprocess your density 
files to include the temperature as part of the color. The render will 
be faster, and you won't have to mess around with adding code to an 
already large and complex system.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Maurya
Subject: Re: Editing density structure
Date: 22 Aug 2003 21:45:01
Message: <web.3f46c6586888b68bc22240400@news.povray.org>
Christopher James Huff wrote:
>In article <web.3f3ab9a392153c77b248b4cf0[at]news.povray.org>,
> "Maurya" <mau### [at] hotmailcom> wrote:
>
>> The density tag can be used with the colormap to render each voxel with
>> a differenct color depending on the density. I want to add another
>> parameter like temperature to each voxel in deciding its color.
>
>As described, you don't need to modify POV. Just preprocess your density
>files to include the temperature as part of the color. The render will
>be faster, and you won't have to mess around with adding code to an
>already large and complex system.
>
>Christopher James Huff <cja### [at] earthlinknet>
>http://home.earthlink.net/~cjameshuff/
>POV-Ray TAG: chr### [at] tagpovrayorg
>http://tag.povray.org/
>

Actually I need to add the temperature tag because I dont want to
use the linear interpolation in the color map. However I have changed the
code and added my temperature tag to it that uses the temperature_file tag
to read data and uses the blackbody radiation to compute the color!
Thanks,
Maurya


Post a reply to this message

From: Chambers
Subject: Re: Editing density structure
Date: 25 Aug 2003 16:02:08
Message: <3f4a6b40@news.povray.org>
"Maurya" <mau### [at] hotmailcom> wrote in message
news:web.3f46c6586888b68bc22240400@news.povray.org...
> Actually I need to add the temperature tag because I dont want to
> use the linear interpolation in the color map. However I have changed the
> code and added my temperature tag to it that uses the temperature_file tag
> to read data and uses the blackbody radiation to compute the color!
> Thanks,
> Maurya

You could still do it by generating a color map of 256 entries, spaced as
you desire (and the linear interpolation would only be used between them,
making it much more accurate).  Something like lookup tables for sin, cos,
sqrt, etc.  Populate it with accurate values, and interpolate between them.

...Chambers


Post a reply to this message

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