POV-Ray : Newsgroups : povray.windows : some question about windows cmd Server Time
23 Nov 2024 11:11:50 EST (-0500)
  some question about windows cmd (Message 11 to 18 of 18)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: 944291641
Subject: Re: some question about windows cmd
Date: 1 Apr 2018 10:55:01
Message: <web.5ac0f1f747c4fa63806aef8c0@news.povray.org>
Stephen <mca### [at] aolcom> wrote:
> On 19/03/2018 00:50, 944291641 wrote:
> > Stephen <mca### [at] aolcom> wrote:
> >> On 18/03/2018 15:00, 944291641 wrote:
> >>> when i use windows cmd to execute my pov program,it cannot find some file in the
> >>> path of pov program:
> >>> for example:
> >>> my cmd is:"start pvengine /render G:\\patht_to_code\\model.ini"
> >>> and code like this:
> >>> + source
> >>>     t1.pov // it contain "#include "TOMLEAF.inc"" ,but no means
> >>>     TOMLEAF.inc
> >>>     something else
> >>>
> >>> could anyone help me? thanks a million!
> >>>
> >>>
> >>
> >> Try implicitly defining the path to the *.pov file in the ini file and
> >> the include file.
> >> Also you could define the location of library files in povray.ini. Like:
> >> Library_Path="G:\Libraries\Documents\POV-Ray\v3.7\include"
> >>
> >>
> >> --
> >>
> >> Regards
> >>       Stephen
> >
> > it work! thank you very much Stephen!
> >
> >
>
> Phew! I'm glad. :-)
>
> I ran into the same problem myself, last week.
> It was from using machine generated code that I was rendering manually
> from a different directory than where it was created.
>
> --
>
> Regards
>      Stephen
Thank you again for your help!
It is same for me that I was rendering a file which didn't in where it was
created.

Recently I have encounter another question , could you give me a hand?

I build a scene which contains some trees, and I want calculate the area of the
sunlit leaf and the shaded leaf. For that I am a  Pov-Ray beginner, I don't know
if there is any functions that can achieve this goal.

Thank you for your warm-hearted.
Regards
    Longkey


Post a reply to this message

From: Bald Eagle
Subject: Re: some question about windows cmd
Date: 1 Apr 2018 11:35:01
Message: <web.5ac0fb2d47c4fa635cafe28e0@news.povray.org>
"944291641" <944### [at] qqcom> wrote:

> Recently I have encounter another question , could you give me a hand?
>
> I build a scene which contains some trees, and I want calculate the area of the
> sunlit leaf and the shaded leaf. For that I am a  Pov-Ray beginner, I don't know
> if there is any functions that can achieve this goal.



Do you need to calculate that for ALL the leaves in a scene, or just one?

You could probably render a single leaf, with a fairly artificial setup that
gives a certain color of final rendered pixel for lit, a certain color for
unlit, and a distinct background color (I'd go with transparent).

Then you could scan and count the pixels of the different colors.

Sorta like this:
http://news.povray.org/povray.binaries.images/thread/%3Cweb.58cfc0cf857600e8c437ac910%40news.povray.org%3E/?mtop=416151


POV-Ray has internal processes that count ray-object intersections, and there is
also trace () and eval_pigment ().

Perhaps there's a way to determine how much total leaf area there is, how much
is directly lit, and then subtract lit from total.


Post a reply to this message

From: Alain
Subject: Re: some question about windows cmd
Date: 1 Apr 2018 15:40:12
Message: <5ac1359c$1@news.povray.org>
Le 18-04-01 à 11:30, Bald Eagle a écrit :
> "944291641" <944### [at] qqcom> wrote:
> 
>> Recently I have encounter another question , could you give me a hand?
>>
>> I build a scene which contains some trees, and I want calculate the area of the
>> sunlit leaf and the shaded leaf. For that I am a  Pov-Ray beginner, I don't know
>> if there is any functions that can achieve this goal.
> 
> 
> 
> Do you need to calculate that for ALL the leaves in a scene, or just one?
> 
> You could probably render a single leaf, with a fairly artificial setup that
> gives a certain color of final rendered pixel for lit, a certain color for
> unlit, and a distinct background color (I'd go with transparent).
> 
> Then you could scan and count the pixels of the different colors.
> 
> Sorta like this:
>
http://news.povray.org/povray.binaries.images/thread/%3Cweb.58cfc0cf857600e8c437ac910%40news.povray.org%3E/?mtop=416151
> 
> 
> POV-Ray has internal processes that count ray-object intersections, and there is
> also trace () and eval_pigment ().
> 
> Perhaps there's a way to determine how much total leaf area there is, how much
> is directly lit, and then subtract lit from total.
> 
> 

eval_pigment() return the raw value of the pigment at a specific point. 
It can't take illumination into account.

To tell is some point on some object is lit or not, you need to take 
that onject, bind it with every other objects in your scene, trace from 
the light's location toward the object.
Now, you need to see if the trace hit your object, or some other 
intervening object. That mean comparing the result returned by the 
trace() with the actual location of your object.

Any transparent object can intercept the trace, so, the fully 
transparent objects need to be removed.
If you have an object that is transparent in only some of it's part, or 
is partially transparent due to a filtering or transmiting texture, 
then, you need to identify that object and do another trace from just 
past that object onward IF you hit a transparent part.


Post a reply to this message

From: 944291641
Subject: Re: some question about windows cmd
Date: 2 Apr 2018 08:00:02
Message: <web.5ac1dfda47c4fa63806aef8c0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "944291641" <944### [at] qqcom> wrote:
>
> > Recently I have encounter another question , could you give me a hand?
> >
> > I build a scene which contains some trees, and I want calculate the area of the
> > sunlit leaf and the shaded leaf. For that I am a  Pov-Ray beginner, I don't know
> > if there is any functions that can achieve this goal.
>
>
>
> Do you need to calculate that for ALL the leaves in a scene, or just one?
>
> You could probably render a single leaf, with a fairly artificial setup that
> gives a certain color of final rendered pixel for lit, a certain color for
> unlit, and a distinct background color (I'd go with transparent).
>
> Then you could scan and count the pixels of the different colors.
>
> Sorta like this:
>
http://news.povray.org/povray.binaries.images/thread/%3Cweb.58cfc0cf857600e8c437ac910%40news.povray.org%3E/?mtop=4161
51
>
>
> POV-Ray has internal processes that count ray-object intersections, and there is
> also trace () and eval_pigment ().
>
> Perhaps there's a way to determine how much total leaf area there is, how much
> is directly lit, and then subtract lit from total.
Thanks for your reply!
What I need is to cal the number of lit leaf pixels from the image rendered by
pov-ray. I will try give it different color, thank you very much.


Post a reply to this message

From: 944291641
Subject: Re: some question about windows cmd
Date: 2 Apr 2018 08:00:03
Message: <web.5ac1e10247c4fa63806aef8c0@news.povray.org>
Alain <kua### [at] videotronca> wrote:
> Le 18-04-01 à 11:30, Bald Eagle a écrit :
> > "944291641" <944### [at] qqcom> wrote:
> >
> >> Recently I have encounter another question , could you give me a hand?
> >>
> >> I build a scene which contains some trees, and I want calculate the area of the
> >> sunlit leaf and the shaded leaf. For that I am a  Pov-Ray beginner, I don't know
> >> if there is any functions that can achieve this goal.
> >
> >
> >
> > Do you need to calculate that for ALL the leaves in a scene, or just one?
> >
> > You could probably render a single leaf, with a fairly artificial setup that
> > gives a certain color of final rendered pixel for lit, a certain color for
> > unlit, and a distinct background color (I'd go with transparent).
> >
> > Then you could scan and count the pixels of the different colors.
> >
> > Sorta like this:
> >
http://news.povray.org/povray.binaries.images/thread/%3Cweb.58cfc0cf857600e8c437ac910%40news.povray.org%3E/?mtop=41
6151
> >
> >
> > POV-Ray has internal processes that count ray-object intersections, and there is
> > also trace () and eval_pigment ().
> >
> > Perhaps there's a way to determine how much total leaf area there is, how much
> > is directly lit, and then subtract lit from total.
> >
> >
>
> eval_pigment() return the raw value of the pigment at a specific point.
> It can't take illumination into account.
>
> To tell is some point on some object is lit or not, you need to take
> that onject, bind it with every other objects in your scene, trace from
> the light's location toward the object.
> Now, you need to see if the trace hit your object, or some other
> intervening object. That mean comparing the result returned by the
> trace() with the actual location of your object.
>
> Any transparent object can intercept the trace, so, the fully
> transparent objects need to be removed.
> If you have an object that is transparent in only some of it's part, or
> is partially transparent due to a filtering or transmiting texture,
> then, you need to identify that object and do another trace from just
> past that object onward IF you hit a transparent part.
Thank you for your advice, I will try it as soon as possible.
Thank you again. :)


Post a reply to this message

From: 944291641
Subject: Re: some question about windows cmd
Date: 4 Apr 2018 09:35:00
Message: <web.5ac4d40a47c4fa63806aef8c0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "944291641" <944### [at] qqcom> wrote:
>
> > Recently I have encounter another question , could you give me a hand?
> >
> > I build a scene which contains some trees, and I want calculate the area of the
> > sunlit leaf and the shaded leaf. For that I am a  Pov-Ray beginner, I don't know
> > if there is any functions that can achieve this goal.
>
>
>
> Do you need to calculate that for ALL the leaves in a scene, or just one?
>
> You could probably render a single leaf, with a fairly artificial setup that
> gives a certain color of final rendered pixel for lit, a certain color for
> unlit, and a distinct background color (I'd go with transparent).
>
> Then you could scan and count the pixels of the different colors.
>
> Sorta like this:
>
http://news.povray.org/povray.binaries.images/thread/%3Cweb.58cfc0cf857600e8c437ac910%40news.povray.org%3E/?mtop=4161
51
>
>
> POV-Ray has internal processes that count ray-object intersections, and there is
> also trace () and eval_pigment ().
>
> Perhaps there's a way to determine how much total leaf area there is, how much
> is directly lit, and then subtract lit from total.
Thanks for you kindness, I have try to set the color of shaded leaf, but I
failed.Could you give me a hand that how to setup the lit and the unlit in
different color?


Post a reply to this message

From: Alain
Subject: Re: some question about windows cmd
Date: 4 Apr 2018 14:56:49
Message: <5ac51ff1@news.povray.org>
Le 18-04-04 à 09:32, 944291641 a écrit :
> "Bald Eagle" <cre### [at] netscapenet> wrote:
>> "944291641" <944### [at] qqcom> wrote:
>>
>>> Recently I have encounter another question , could you give me a hand?
>>>
>>> I build a scene which contains some trees, and I want calculate the area of the
>>> sunlit leaf and the shaded leaf. For that I am a  Pov-Ray beginner, I don't know
>>> if there is any functions that can achieve this goal.
>>
>>
>>
>> Do you need to calculate that for ALL the leaves in a scene, or just one?
>>
>> You could probably render a single leaf, with a fairly artificial setup that
>> gives a certain color of final rendered pixel for lit, a certain color for
>> unlit, and a distinct background color (I'd go with transparent).
>>
>> Then you could scan and count the pixels of the different colors.
>>
>> Sorta like this:
>>
http://news.povray.org/povray.binaries.images/thread/%3Cweb.58cfc0cf857600e8c437ac910%40news.povray.org%3E/?mtop=4161
> 51
>>
>>
>> POV-Ray has internal processes that count ray-object intersections, and there is
>> also trace () and eval_pigment ().
>>
>> Perhaps there's a way to determine how much total leaf area there is, how much
>> is directly lit, and then subtract lit from total.
> Thanks for you kindness, I have try to set the color of shaded leaf, but I
> failed.Could you give me a hand that how to setup the lit and the unlit in
> different color?
> 
> 
> 
> 

There is no reasonable way to assign a different colour to an object 
depending on whether it is lit or not. It's simply because the actual 
pigment is illumination independent.
To know if any point is illuminated or not, the only way is to trace 
from the light that interest you toward an union containing the surface 
that interest you and see if it get intercepted early.
You need to repeat for each point of your object, and it will get 
*really* long. For each point you need to compute the exact direction 
that may differ by only a fraction of arc second, perform the trace, 
check if the returned coordinate match that of your surface, then, 
somehow create a custom pattern based on that result.
Extremely long and error prone.

Without going through all that, when you render your scene, unlighted 
part will always be darker.
It's possible to get radically different colours by using the 
projected_through light option:

Set the ambient to zero everywhere.
Bind your whole scene into a big union.
Use a regular light that is coloured.
Use a second light using the complementary colour from the main light, 
place it at exactly the same location and make it projected_through 
using your union.

Now, every part of your scene that is in the shadow from the main light 
is illuminated only by the projected_through light with a totally 
different colour.


Post a reply to this message

From: clipka
Subject: Re: some question about windows cmd
Date: 4 Apr 2018 15:26:14
Message: <5ac526d6$1@news.povray.org>
Am 04.04.2018 um 15:32 schrieb 944291641:

> Thanks for you kindness, I have try to set the color of shaded leaf, but I
> failed.Could you give me a hand that how to setup the lit and the unlit in
> different color?

You could just use plain old boring standard illumination:

    #declare MyTree = mesh { ... /* no textures here */ }

    object {
      MyTree
      texture {
        pigment { rgb 1 /* white */ }
        finish {
          ambient 0 /* shadowed areas should look pitch black */
          diffuse 1 /* lit areas should look as bright as possible */
        }
      }
    }

This would give you an image where all unlit areas are pitch black, and
all lit areas are some shade of grey (or white).


You can also use the `brilliance` mechanism to make the brightness of
the lit areas independent of the direction of illumination:

    object {
      MyTree
      texture {
        pigment { rgb 1 /* white */ }
        finish {
          ambient 0 /* shadowed areas should look pitch black */
          diffuse 1 /* lit areas should look as bright as possible */
          brilliance 0 /* incident light angle is totally irrelevant */
        }
      }
    }

If you want to use two different colours instead of black and white, you
can achieve this as well by toying with the light source colour and
ambient; e.g. to have the shadowed areas look red and the lit areas
green, you could use:

    object {
      MyTree
      texture {
        pigment { rgb 1 /* white */ }
        finish {
          ambient rgb <1,0,0> /* red */
          diffuse 1
          brilliance 0
        }
      }
    }

    light_source {
      MyLightSourcePosition
      rgb <-1,1,0> /* negative red cancels the ambient on lit areas,
                      positive green makes them look green */
    }


If you need to know which portions of the leaves are lit, even for
leaves that are not visible from the camera, you can use the mesh camera
to "bake" a texture map for the tree with the corresponding colors for
the lit and unlit areas; I'm not familiar the syntax though.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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