 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Hi,
Sorry if these are in the manual, I could not find them... :-(
1: is it possible (if so, how?) to have 2 density maps which has one
density map dependant on the other, for instane, a bozo pattern which
fades as per a gradient y pattern?
2: in a density map, which is applied to a box 10 units high, typical
map values are:
density{
gradient y
density_map {
[0 blah...]
[1 blah...]
}}
does the "1" correspond to 1 unit up or 10 units up (ie: the box is
normalized with respect to the density_map). The reason I ask is that
for some reason I have forgotten all I have known about pov... and I
have lost all my old code :-(
thanks a lot
paul
--
--------------------------------------------------}
Paul Daniel Jones
The Pennslyvania State University
pdj### [at] psu edu
http://research.chem.psu.edu/glassgrp/paul
C The way is near, but men
// \ seek it afar. It is in the
N N easy things, but men seek it
| || in the difficult things.
C C -Menicius
\\ /
C
--------------------------------------------------}
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
All is not lost.
Yes, you can "multiply" or "add" medias. Two or more densities in one media
multiply. Two or more media statements in a interior add together.
To get the effect you asked about use the multiply method. Any rgb zero
index cancels out another, [0 rgb 0.5] in first and [0 rgb 0.6] in the
second makes for a [0 rgb 0.3] result.
There is a help section on this but that's pretty much it.
Map indices 0 to 1 are initially one POV unit. Scaling is needed to apply
to a larger object. The 'scale' keyword goes after the map } and before the
closing density }.
Be aware that scaling of the media object as a whole, by contrast, requires
that you scale the media inversely.
Bob H.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Bob H." <omn### [at] msn com> wrote in message
news:3b142b12@news.povray.org...
> All is not lost.
Except me, often.
> Map indices 0 to 1 are initially one POV unit. Scaling is needed to apply
I should have said in the case of gradient and marble patterns, and others
like them, which have a linear axis can be thought of as applicable to a
blend map's equaling 1 unit. Patterns with noise or a formula aren't so
measurable.
Bob H.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3b142b12@news.povray.org>, "Bob H." <omn### [at] msn com>
wrote:
> Map indices 0 to 1 are initially one POV unit.
What do you mean here? The map indices are just mapped to the density
pattern like any other map...they don't necessarily correspond to units
of distance.
> Be aware that scaling of the media object as a whole, by contrast, requires
> that you scale the media inversely.
This doesn't make sense either...I assume you are talking about scaling
the density of the media. The media feature uses the distance travelled
through the media, ignoring any effects scale would have, so you have to
scale the densities to get two objects of different sizes to look the
same.
--
Christopher James Huff - chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Chris Huff" <chr### [at] mac com> wrote in message
news:chr### [at] povray org...
> In article <3b142b12@news.povray.org>, "Bob H." <omn### [at] msn com>
> wrote:
>
> > Map indices 0 to 1 are initially one POV unit.
>
> What do you mean here? The map indices are just mapped to the density
> pattern like any other map...they don't necessarily correspond to units
> of distance.
Sure. Doesn't a gradient x pattern coorespond to 0*x to 1*x and then repeat
at 1 unit intervals? Of course it does. However not all patterns are of a
linear nature to measure like that one, which is what I said. So that the
pattern defaults to 1 unit until rescaled.
> > Be aware that scaling of the media object as a whole, by contrast,
requires
> > that you scale the media inversely.
>
> This doesn't make sense either...I assume you are talking about scaling
> the density of the media. The media feature uses the distance travelled
> through the media, ignoring any effects scale would have, so you have to
> scale the densities to get two objects of different sizes to look the
> same.
Very imprecise description I gave there, sorry.
Bob H.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Chris Huff <chr### [at] mac com> wrote:
: The media feature uses the distance travelled
: through the media, ignoring any effects scale would have, so you have to
: scale the densities to get two objects of different sizes to look the
: same.
This is a bad thing in my opinion.
Usually you expect that this:
#include "MyObject.inc"
camera { location <0,1,2> look_at 0 }
light_source { <10,20,-30>, 1}
object { MyObject }
and this:
#include "MyObject.inc"
camera { location <0,1,2>*10 look_at 0 }
light_source { <10,20,-30>*10, 1}
object { MyObject scale 10}
would give you identical results. That is, the scale of the whole scene
does not affect the result.
However, if 'MyObject' contains media, the result will not be identical.
In my opinion the 'scale 10' should scale the density as well so that
you really get the same result.
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Warp" <war### [at] tag povray org> wrote in message news:3b165264@news.povray.org...
> This is a bad thing in my opinion.
<snip>
I know what you mean, but it's six of one, half a dozen of the other. It does mean
that two identical medias placed in separate containers will behave consistently,
even if you then scale the containers seperately.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Warp" <war### [at] tag povray org> wrote in message
news:3b165264@news.povray.org...
> Chris Huff <chr### [at] mac com> wrote:
> : The media feature uses the distance travelled
> : through the media, ignoring any effects scale would have, so you have to
> : scale the densities to get two objects of different sizes to look the
> : same.
>
> This is a bad thing in my opinion.
>
> would give you identical results. That is, the scale of the whole scene
> does not affect the result.
> However, if 'MyObject' contains media, the result will not be identical.
>
> In my opinion the 'scale 10' should scale the density as well so that
> you really get the same result.
I agree completely. You wouldn't want textures such as refraction changing
it's IOR. This was talked of before, guessing no one was bold enough to
make the change. Either that or there's more involved, even possibly meant
to be that way instead.
But yes, it sure would be more like other expected behavior. I don't think
any texture patterns are allowed to move off of a scaled object anyway.
Bob H.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
If you scale an object containing media,
the density pattern is scaled too.
But the density color isn't affected.
So if you want to get the same result after
scaling you should do something like this :
...
density{yourcolor*1/scalevalue}
...
where scalevalue is the amount with which
you scaled the object or the whole scene.
You'll have to do this with every color in
your density statement.
-------
Nubere vis Prisco : Non miror, Paula, sapisti.
Ducere te non vult Priscus : Et ille sapit.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Thu, 31 May 2001 10:47:13 -0500, Bob H. wrote:
>I agree completely. You wouldn't want textures such as refraction changing
>it's IOR. This was talked of before, guessing no one was bold enough to
>make the change. Either that or there's more involved, even possibly meant
>to be that way instead.
It is meant to be that way. It was filed as a bug report in (IIRC) the 3.1
beta timeframe, and whoever was responsible for the code at the time felt
that it should work that way.
It really can be argued both ways, but those who would argue that the density
factor should scale with the container have a difficult question to answer:
how should it scale when the container is scaled nonuniformly?
--
#macro R(L P)sphere{L F}cylinder{L P F}#end#macro P(V)merge{R(z+a z)R(-z a-z)R(a
-z-z-z a+z)torus{1F clipped_by{plane{a 0}}}translate V}#end#macro Z(a F T)merge{
P(z+a)P(z-a)R(-z-z-x a)pigment{rgbt 1}hollow interior{media{emission T}}finish{
reflection.1}}#end Z(-x-x.2y)Z(-x-x.4x)camera{location z*-10rotate x*90}
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Ron Parker" <ron### [at] povray org> wrote in message
news:slr### [at] fwi com...
> It really can be argued both ways, but those who would argue that the density
> factor should scale with the container have a difficult question to answer:
> how should it scale when the container is scaled nonuniformly?
Ouch! Now my brain hurts. I think I pulled something...
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Simon <sim### [at] surfeu de> wrote:
: So if you want to get the same result after
: scaling you should do something like this :
: ...
: density{yourcolor*1/scalevalue}
But this is exactly what I don't want to be forced to do.
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ron Parker <ron### [at] povray org> wrote:
: how should it scale when the container is scaled nonuniformly?
It should scale so that if you, for example, scale the object to be
twice as wide on screen, render and then squeeze the image to half-size
in width (eg. just drop out every other column of pixels), the image should
be the same (perhaps not 100% identical, but by all practical means the same,
that is, minor differences in individual pixels not noticeable).
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 31 May 2001 12:02:24 -0400, Warp wrote:
>Ron Parker <ron### [at] povray org> wrote:
>: how should it scale when the container is scaled nonuniformly?
>
> It should scale so that if you, for example, scale the object to be
>twice as wide on screen, render and then squeeze the image to half-size
>in width (eg. just drop out every other column of pixels), the image should
>be the same (perhaps not 100% identical, but by all practical means the same,
>that is, minor differences in individual pixels not noticeable).
Well, that's not strictly true unless you use an orthographic camera, so let's
assume that you meant to say "with an orthographic camera."
Even assuming that, we have a problem: if we take a sphere and scale it
nonuniformly, perhaps by stretching it by a factor of 2 along the Y axis,
now we have to make the density factor depend on the direction of the
ray we're measuring: a ray traveling parallel to the X axis should use
the same density factor it would have without scaling, but a ray traveling
parallel to the Y axis should use half the density factor.
Interestingly enough, that turns into an argument for the notion that POV
should scale the density factor with the object whenever it would scale
the density pattern with the object, because while you could get the
current behavior by scaling the object before the interior statement in
a world where scale affected the factor, you can't get the behavior you
described at all in the current model.
I think the change could be implemented, but I also think it would require
some pretty big changes in the media code.
--
#macro R(L P)sphere{L F}cylinder{L P F}#end#macro P(V)merge{R(z+a z)R(-z a-z)R(a
-z-z-z a+z)torus{1F clipped_by{plane{a 0}}}translate V}#end#macro Z(a F T)merge{
P(z+a)P(z-a)R(-z-z-x a)pigment{rgbt 1}hollow interior{media{emission T}}finish{
reflection.1}}#end Z(-x-x.2y)Z(-x-x.4x)camera{location z*-10rotate x*90}
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3b166b10@news.povray.org>, Warp <war### [at] tag povray org>
wrote:
> It should scale so that if you, for example, scale the object to be
> twice as wide on screen...
What about scaling it to be half as deep? Or 10 times as long as it was?
If this is ever done, it should be as an option, probably with several
methods...greatest/smallest scale component, average scale component,
etc...otherwise, you will end up with some kind of direction-dependant
density...a neat idea, but not a good behavior for transformations in my
opinion.
--
Christopher James Huff - chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Makes me conjure up a new keyword known as 'fixed', or 'static' or something
similar.
If you wanted to retain a unaffected media density when scaling then you'd
set it into a fixed unchanging state. I hadn't thought of that nonuniform
scaling problem. Maybe if it were at least either A: unaffected media or B:
affected by scaling, then that would suffice without need to complicate
things.
Kind of an addendum to what Ron was saying.
Bob H.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Warp" wrote:
> Simon wrote:
> : So if you want to get the same result after
> : scaling you should do something like this :
> : ...
> : density{yourcolor*1/scalevalue}
>
> But this is exactly what I don't want to be forced to do.
I too have been annoyed by the current behavior, but when thinking about it
I think it's more logical this way after all.
Think about object attenuation. Using fade_power and fade_distance we can
simulate attenuation. It is a property of the material the object is made
of. If we scale the object twice as big, then, like in real life, the
attenuation is stronger because the light travels through more of it. That
is logical.
Why should media be any different? Media is also a property of the material,
and in reality it would be stronger when it is larger. Just take any colored
liquid as an example.
IMHO the current behavior should be continued.
But the current method does have problems too, so a switch to change between
behaviors would be even better...
Rune
--
3D images and anims, include files, tutorials and more:
Rune's World: http://rsj.mobilixnet.dk (updated May 10)
POV-Ray Users: http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Rune" <run### [at] mobilixnet dk> wrote in message
news:3b169d40@news.povray.org...
>
> Think about object attenuation. Using fade_power and fade_distance we can
> simulate attenuation. It is a property of the material the object is made
> of. If we scale the object twice as big, then, like in real life, the
> attenuation is stronger because the light travels through more of it. That
> is logical.
I know, but...
> Why should media be any different? Media is also a property of the
material,
> and in reality it would be stronger when it is larger. Just take any
colored
> liquid as an example.
Yes, but not in the sense that were that object a drinking glass with some
attenuation and you simply rescaled for one reason or another you wouldn't
want it attenuating light more or less than originally when it's resized
only to fit another scene.
> But the current method does have problems too, so a switch to change
between
> behaviors would be even better...
No arguments from me.
Bob H.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Ron Parker" <ron### [at] povray org> wrote:
> It really can be argued both ways, but those who would argue that the
> density factor should scale with the container have a difficult question
> to answer: how should it scale when the container is scaled nonuniformly?
>
>
>
If you think of media as tiny emitting/absorbing/reflecting particles in the
container's volume (which is what it is supposed to model) there are only
two possible ways to handle scaling the container AFAICS.
The current method is to keep constant the "number of particles" per unit of
volume. Thus if you scale the container, the total number of media particles
in the container changes and thus the apparent opacity changes. Frankly, I
think this is perfecly logical and in no way inferior to the alternative.
The other possible approach, the one which people seem to be talking about
here, is to keep constant the "number of media particles" in the container,
irrespective of scaling. Obviously this only gives the result people expect
if the container is scaled uniformly. Anyway, the correct conversion should
be something like:
Mult=sqrt(3)/vlength(Scale)
where Scale is the scaling vector of the container, and Mult is the
multiplier to be applied to the media density in the scaled container.
Since it only keeps the apparent opacity if the scaling is uniform, I'm not
sure it would be such a good default. People would then probably expect the
opacity to always stay the same, and it would be even harder to explain to
them why this is not the case with non-uniform scaling.
--
Margus Ramst
Personal e-mail: mar### [at] peak edu ee
TAG (Team Assistance Group) e-mail: mar### [at] tag povray org
Home page http://www.hot.ee/margusrt
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Ron Parker" <ron### [at] povray org> wrote:
>
> Interestingly enough, that turns into an argument for the notion that POV
> should scale the density factor with the object whenever it would scale
> the density pattern with the object, because while you could get the
> current behavior by scaling the object before the interior statement in a
> world where scale affected the factor, you can't get the behavior you
> described at all in the current model.
>
> I think the change could be implemented, but I also think it would require
> some pretty big changes in the media code.
>
Hmm...
That would mean anisotropic absorption/emission, right?
It would be an interesting option to have, certainly. But frankly I'm not
sure if I'd want it as the default behaviour.
--
Margus Ramst
Personal e-mail: mar### [at] peak edu ee
TAG (Team Assistance Group) e-mail: mar### [at] tag povray org
Home page http://www.hot.ee/margusrt
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Sun, 03 Jun 2001 00:21:48 +0200, Margus Ramst wrote:
>That would mean anisotropic absorption/emission, right?
Probably not. It just means transforming the ray into the media's original
space before calculating the media's effect on it. The result is anisotropic,
but only because the scaling is also anisotropic.
--
#macro R(L P)sphere{L F}cylinder{L P F}#end#macro P(V)merge{R(z+a z)R(-z a-z)R(a
-z-z-z a+z)torus{1F clipped_by{plane{a 0}}}translate V}#end#macro Z(a F T)merge{
P(z+a)P(z-a)R(-z-z-x a)pigment{rgbt 1}hollow interior{media{emission T}}finish{
reflection.1}}#end Z(-x-x.2y)Z(-x-x.4x)camera{location z*-10rotate x*90}
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |