![](/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) |
I do not understand why the position of this object controls its appearance.
Any clues?
I seem to have covered all position based params with the macro variable...
Source below:
// ----------------------------------------
camera
{
right x*image_width/image_height
location <0, 0, -5>
look_at <0, 0, 0>
}
// ----------------------------------------
#macro BlackHoleWarp(Iterations, Falloff, Strength, Position, Radius)
#local counter = 0; // set counter to 0
#while (counter < Iterations)
warp
{
black_hole Position, Radius
falloff Falloff
strength Strength
turbulence 0.4
}
#local counter = counter + 1;
#end
#end
#macro Glow(glowPosition, glowRadius, glowColor)
light_source
{
glowPosition
color rgb glowColor
looks_like
{
sphere
{
glowPosition, glowRadius
hollow
pigment
{
rgbt <0, 0, 0, 1>
}
interior
{
media
{
intervals 1 // scale this in relation to distance from
camera
samples 1, 1
emission glowColor
density
{
spherical
scale 3
density_map
{
[0.0 rgb glowColor * 0.000]
[0.8 rgb glowColor * 0.250]
[0.9 rgb glowColor * 0.750]
[1.0 rgb glowColor * 1.000]
}
}
density
{
spherical
density_map
{
[0.00 color rgb glowColor * 0.000]
[ 0.90
granite
color_map
{
[0 color rgb glowColor * 0.750]
[1 color rgb glowColor * 0.250]
}
//BlackHoleWarp(4, 1, 1, glowPosition, 1)
]
[1.00 color rgb glowColor * 1.500]
}
}
}
}
finish
{
reflection 0
diffuse 0
ambient 0
phong 0
specular 0
brilliance 0
}
}
}
}
#end
Glow(<2, 0, 0>, 2, <1, 1, 1>)
Glow(<0, 0, 0>, 2, <0.5, 0.5, 0.55> * 1.5)
Glow(<-2, 0, 0>, 2, <0, 0.5, 0.5> * 1.5)
plane
{
<0, 1, 0>, 0
hollow
texture
{
pigment
{
color rgb <0.5, 0.5, 0.55>
}
}
scale <1, 1, 1>
translate <0, -1, 0>
}
Post a reply to this message
Attachments:
Download 'mediaglow2011_0.png' (55 KB)
Preview of image 'mediaglow2011_0.png'
![mediaglow2011_0.png](/povray.binaries.images/attachment/%3Cweb.4eaa95c011cbbbbd77e50e540%40news.povray.org%3E/mediaglow2011_0.png?ttop=443866&toff=1950&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: clipka
Subject: Re: strange behavior, lightsource + lookslike + media
Date: 28 Oct 2011 08:43:31
Message: <4eaaa373@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Am 28.10.2011 13:45, schrieb [GDS|Entropy]:
> I do not understand why the position of this object controls its appearance.
> Any clues?
Yes: You failed to translate the sperical pattern to the desired position.
I suggest to compose the Glow thing at <0,0,0>, and finally translate it
to where you want it:
> #macro Glow(glowPosition, glowRadius, glowColor)
> light_source
> {
> glowPosition
replace this line with:
<0,0,0>
> color rgb glowColor
> looks_like
> {
> sphere
> {
> glowPosition, glowRadius
replace this line with:
<0,0,0>, glowRadius
> hollow
> pigment
> {
> rgbt<0, 0, 0, 1>
> }
> interior
> {
> media
> {
> intervals 1 // scale this ...
> samples 1, 1
> emission glowColor
> density
> {
> spherical
> scale 3
> density_map
> {
> [0.0 rgb glowColor * 0.000]
> [0.8 rgb glowColor * 0.250]
> [0.9 rgb glowColor * 0.750]
> [1.0 rgb glowColor * 1.000]
> }
> }
> density
> {
> spherical
> density_map
> {
> [0.00 color rgb glowColor * 0.000]
> [ 0.90
> granite
> color_map
> {
> [0 color rgb glowColor * 0.750]
> [1 color rgb glowColor * 0.250]
> }
> //BlackHoleWarp(4, 1, 1, glowPosition, 1)
remove this line (or keep it commented out)
> ]
> [1.00 color rgb glowColor * 1.500]
> }
> }
> }
> }
> finish
> {
> reflection 0
> diffuse 0
> ambient 0
> phong 0
> specular 0
> brilliance 0
> }
> }
> }
insert here:
translate glowPosition
> }
> #end
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) |
clipka <ano### [at] anonymous org> wrote:
>snip
Good catch!
However, instead of two hemispheres 1 unit away from the central glow sphere,
they are now inside it. The issue of appearance altering with translation
persists.
I can see that the light source has translated, but it almost looks like the
media didn't.
Weird...
Ian
Post a reply to this message
Attachments:
Download 'mediaglow2011_0.png' (46 KB)
Preview of image 'mediaglow2011_0.png'
![mediaglow2011_0.png](/povray.binaries.images/attachment/%3Cweb.4eaaafc3693b004877e50e540%40news.povray.org%3E/mediaglow2011_0.png?ttop=443866&toff=1950&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: clipka
Subject: Re: strange behavior, lightsource + lookslike + media
Date: 29 Oct 2011 08:48:42
Message: <4eabf62a@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Am 28.10.2011 15:36, schrieb [GDS|Entropy]:
> However, instead of two hemispheres 1 unit away from the central glow sphere,
> they are now inside it. The issue of appearance altering with translation
> persists.
>
> I can see that the light source has translated, but it almost looks like the
> media didn't.
>
> Weird...
To be honest, you just discovered a bug in 3.7.RC3 there. Apparently,
when a light source is translated, the looks_like object is translated
as well, but not its members (such as media).
3.6.2 does it right. Gotta fix this.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: clipka
Subject: Re: strange behavior, lightsource + lookslike + media
Date: 29 Oct 2011 08:57:44
Message: <4eabf848$1@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Am 29.10.2011 14:48, schrieb clipka:
> To be honest, you just discovered a bug in 3.7.RC3 there. Apparently,
> when a light source is translated, the looks_like object is translated
> as well, but not its members (such as media).
The issue can be worked around by creating the light source at the
target location - as you originally did; but note that a looks_like
object always needs to be specified as if the light source was at <0,0,0>.
Thus the following code should work with both 3.6.2 and 3.7.0.RC3:
> #macro Glow(glowPosition, glowRadius, glowColor)
> light_source
> {
> glowPosition
Leave this line as is.
> color rgb glowColor
> looks_like
> {
> sphere
> {
> glowPosition, glowRadius
Replace this line with:
<0,0,0>, glowRadius
> hollow
> pigment
> {
> rgbt<0, 0, 0, 1>
> }
> interior
> {
> media
> {
> intervals 1 // scale this ...
> samples 1, 1
> emission glowColor
> density
> {
> spherical
> scale 3
> density_map
> {
> [0.0 rgb glowColor * 0.000]
> [0.8 rgb glowColor * 0.250]
> [0.9 rgb glowColor * 0.750]
> [1.0 rgb glowColor * 1.000]
> }
> }
> density
> {
> spherical
> density_map
> {
> [0.00 color rgb glowColor * 0.000]
> [ 0.90
> granite
> color_map
> {
> [0 color rgb glowColor * 0.750]
> [1 color rgb glowColor * 0.250]
> }
> //BlackHoleWarp(4, 1, 1, glowPosition, 1)
You'll probably need to replace this line with the following (in case
you ultimately decide to re-activate it):
//BlackHoleWarp(4, 1, 1, <0,0,0>, 1)
> ]
> [1.00 color rgb glowColor * 1.500]
> }
> }
> }
> }
> finish
> {
> reflection 0
> diffuse 0
> ambient 0
> phong 0
> specular 0
> brilliance 0
> }
> }
> }
Do NOT insert a translate here.
> }
> #end
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Alain
Subject: Re: strange behavior, lightsource + lookslike + media
Date: 29 Oct 2011 14:20:54
Message: <4eac4406@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> I do not understand why the position of this object controls its appearance.
> Any clues?
>
> I seem to have covered all position based params with the macro variable...
>
> Source below:
>
> // ----------------------------------------
>
> camera
> {
> right x*image_width/image_height
> location<0, 0, -5>
> look_at<0, 0, 0>
> }
>
> // ----------------------------------------
>
> #macro BlackHoleWarp(Iterations, Falloff, Strength, Position, Radius)
> #local counter = 0; // set counter to 0
> #while (counter< Iterations)
>
> warp
> {
> black_hole Position, Radius
> falloff Falloff
> strength Strength
> turbulence 0.4
> }
>
> #local counter = counter + 1;
> #end
> #end
>
> #macro Glow(glowPosition, glowRadius, glowColor)
> light_source
> {
> glowPosition
> color rgb glowColor
> looks_like
> {
> sphere
> {
> glowPosition, glowRadius
A looks_like object location is relative to it's associated light_source.
This light_source have it's looks like correctly placed:
(texture intentionaly omited)
light_source{<100,0,0> rgb 1 looks_like{sphere{0, 1}}}
In your case, using <0,0,0> as the looks_like object location ALSO
translate the media to the correct location.
This one don't, it's located at <200,0,0>:
light_source{<100,0,0> rgb 1 looks_like{sphere{<100,0,0>, 1}}}
Any contained media will be located relative to the light_source, but no
longer with the container.
Some media hints:
intervals MUST remains at 1
samples NEVER use the second parameter when using the default smpling
method: method 3.
As it is, you take only one sample at the mid point of the container and
assume that it don't change.
Also, your containers overlap each other. As the spherical pattern have
an effective radius of 1, reducing your containers radius to that value
suppress the overlap, and some changes related to the location.
Alain
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Alain
Subject: Re: strange behavior, lightsource + lookslike + media
Date: 29 Oct 2011 14:29:59
Message: <4eac4627@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> Am 28.10.2011 15:36, schrieb [GDS|Entropy]:
>> However, instead of two hemispheres 1 unit away from the central glow
>> sphere,
>> they are now inside it. The issue of appearance altering with translation
>> persists.
>>
>> I can see that the light source has translated, but it almost looks
>> like the
>> media didn't.
>>
>> Weird...
>
> To be honest, you just discovered a bug in 3.7.RC3 there. Apparently,
> when a light source is translated, the looks_like object is translated
> as well, but not its members (such as media).
>
> 3.6.2 does it right. Gotta fix this.
I don't know if it's realy a bug, I like to call it an improvement.
Anyway, as it is now, it makes it reasier to correctly place the
looks_like at the same place as the light_source.
You can have something like:
#macro My_light(Location, Colour) = light_source{Location, Colour
looks_like{Some_Object}}}
As long as the object is defined at the origin, then, for any value of
Location, the looks_like object will be at the correct location.
That behaviour did NOT change since the early betas of version 3.7.
Alain
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: clipka
Subject: Re: strange behavior, lightsource + lookslike + media
Date: 29 Oct 2011 15:09:34
Message: <4eac4f6e$1@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Am 29.10.2011 20:29, schrieb Alain:
>> To be honest, you just discovered a bug in 3.7.RC3 there. Apparently,
>> when a light source is translated, the looks_like object is translated
>> as well, but not its members (such as media).
>>
>> 3.6.2 does it right. Gotta fix this.
>
> I don't know if it's realy a bug, I like to call it an improvement.
> Anyway, as it is now, it makes it reasier to correctly place the
> looks_like at the same place as the light_source.
No, it's definitely a bug: If you create the light source at <0,0,0>,
add a looks_like object, then finally translate the whole thing, then
the looks_like object moves (same as per 3.6) - but its texture and
media fails to move with it. That definitely does /not/ make things simpler.
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) |
clipka <ano### [at] anonymous org> wrote:
> Am 29.10.2011 20:29, schrieb Alain:
> >> To be honest, you just discovered a bug in 3.7.RC3 there. Apparently,
> >> when a light source is translated, the looks_like object is translated
> >> as well, but not its members (such as media).
> >>
> >> 3.6.2 does it right. Gotta fix this.
> >
> > I don't know if it's realy a bug, I like to call it an improvement.
> > Anyway, as it is now, it makes it reasier to correctly place the
> > looks_like at the same place as the light_source.
>
> No, it's definitely a bug: If you create the light source at <0,0,0>,
> add a looks_like object, then finally translate the whole thing, then
> the looks_like object moves (same as per 3.6) - but its texture and
> media fails to move with it. That definitely does /not/ make things simpler.
If this is the case, then it explains a similar problem I came across while
making a star in 3.7.0 RC3. I worked around it using a union of a light_source
and a sphere with media and translating that instead.
Regards,
D103
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Alain
Subject: Re: strange behavior, lightsource + lookslike + media
Date: 30 Oct 2011 17:04:02
Message: <4eadbbc2@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> Am 29.10.2011 20:29, schrieb Alain:
>>> To be honest, you just discovered a bug in 3.7.RC3 there. Apparently,
>>> when a light source is translated, the looks_like object is translated
>>> as well, but not its members (such as media).
>>>
>>> 3.6.2 does it right. Gotta fix this.
>>
>> I don't know if it's realy a bug, I like to call it an improvement.
>> Anyway, as it is now, it makes it reasier to correctly place the
>> looks_like at the same place as the light_source.
>
> No, it's definitely a bug: If you create the light source at <0,0,0>,
> add a looks_like object, then finally translate the whole thing, then
> the looks_like object moves (same as per 3.6) - but its texture and
> media fails to move with it. That definitely does /not/ make things
> simpler.
THAT part is definitively a bug. The transform must affect everything,
especialy any texture and media.
The part I do like is that the looks_like object is centered on the
light_source whatever it's effective INITIAL location.
Alain
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) |