POV-Ray : Newsgroups : povray.newusers : getting some existing value as a variable Server Time
1 Nov 2024 08:10:51 EDT (-0400)
  getting some existing value as a variable (Message 1 to 8 of 8)  
From: Mr
Subject: getting some existing value as a variable
Date: 3 Sep 2009 09:30:00
Message: <web.4a9fc4204fc5d1a76ce87ead0@news.povray.org>
Is it possible to get some already defined parameter as the value for some
variable? My reason to ask is I would like to keep the value output by my
exporter for some parameter (light position), and use it in a hand written
macro (SBenge SSS) This would allow to move the light and not having to always
modify the variable pov code by hand.

Say I have a light
light_source { <x,y,z> rgb <1,1,1>*3 spotlight point_at
<-0.281606,0.960535,-0.0901413> falloff 15 radius 12.75 fade_distance 30}

is there anything like
#declare
lpos = light_source.position
that would evaluate to lpos=<x,y,z> ?


Post a reply to this message

From: clipka
Subject: Re: getting some existing value as a variable
Date: 3 Sep 2009 10:03:15
Message: <4a9fcca3$1@news.povray.org>
Mr schrieb:
> Say I have a light
> light_source { <x,y,z> rgb <1,1,1>*3 spotlight point_at
> <-0.281606,0.960535,-0.0901413> falloff 15 radius 12.75 fade_distance 30}
> 
> is there anything like
> #declare
> lpos = light_source.position
> that would evaluate to lpos=<x,y,z> ?

No, querying the properties of scene elements is generally not supported 
by POV-Ray's SDL.

For objects, you can get the approximate position via the min_extent() 
and max_extent() functions, which return the corners of the bounding 
box; I never tried whether this works with light sources as well, but I 
wouldn't bank on it.


Post a reply to this message

From: Mr
Subject: Re: getting some existing value as a variable
Date: 3 Sep 2009 10:20:00
Message: <web.4a9fd022300e4d4f6ce87ead0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Mr schrieb:
> > Say I have a light
> > light_source { <x,y,z> rgb <1,1,1>*3 spotlight point_at
> > <-0.281606,0.960535,-0.0901413> falloff 15 radius 12.75 fade_distance 30}
> >
> > is there anything like
> > #declare
> > lpos = light_source.position
> > that would evaluate to lpos=<x,y,z> ?
>
> No, querying the properties of scene elements is generally not supported
> by POV-Ray's SDL.
>
> For objects, you can get the approximate position via the min_extent()
> and max_extent() functions, which return the corners of the bounding
> box; I never tried whether this works with light sources as well, but I
> wouldn't bank on it.
even more so since my light doesn't have a name

Thanks,I'll just have to type the code for my main light, it will be a chance to
see if I can get anything more from it than by my exporter.


Post a reply to this message

From: Chris B
Subject: Re: getting some existing value as a variable
Date: 3 Sep 2009 12:39:05
Message: <4a9ff129@news.povray.org>
"Mr" <nomail@nomail> wrote in message 
news:web.4a9fc4204fc5d1a76ce87ead0@news.povray.org...
> Is it possible to get some already defined parameter as the value for some
> variable? My reason to ask is I would like to keep the value output by my
> exporter ...

I agree with what's been said so far and at the risk of stating the obvious 
I just wanted to check what you meant by "my exporter". If it's an exporter 
you've written then you can of course get your exporter to #declare a vector 
for the location of your light and use it in both the light_source and for 
any subsequent purposes that you wish:

#declare LPos = <x,y,z>;
light_source {LPos rgb ....

Of course, if you just mean "the exporter you're using" then this is no 
help.

Regards,
Chris B.


Post a reply to this message

From: Mr
Subject: Re: getting some existing value as a variable
Date: 3 Sep 2009 13:05:00
Message: <web.4a9ff619300e4d4f15e458d60@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
> "Mr" <nomail@nomail> wrote in message
> news:web.4a9fc4204fc5d1a76ce87ead0@news.povray.org...
> > Is it possible to get some already defined parameter as the value for some
> > variable? My reason to ask is I would like to keep the value output by my
> > exporter ...
>
> I agree with what's been said so far and at the risk of stating the obvious
> I just wanted to check what you meant by "my exporter". If it's an exporter
> you've written then you can of course get your exporter to #declare a vector
> for the location of your light and use it in both the light_source and for
> any subsequent purposes that you wish:
>
> #declare LPos = <x,y,z>;
> light_source {LPos rgb ....
>
> Of course, if you just mean "the exporter you're using" then this is no
> help.
>
> Regards,
> Chris B.

Unfortunately, it's the exporter I'm using :( Blend2pov) a gpl version used to
exist but nobody has ported it to the current version of blender 2.49 without
closing the source afterwards and since it's not a script anyway but hardcoded,
there's even less chance that I could understand and change it (yet) anyway.
Maybe in a few years/months.


Post a reply to this message

From: clipka
Subject: Re: getting some existing value as a variable
Date: 3 Sep 2009 15:23:34
Message: <4aa017b6$1@news.povray.org>
Mr schrieb:
> Unfortunately, it's the exporter I'm using :( Blend2pov) a gpl version used to
> exist but nobody has ported it to the current version of blender 2.49 without
> closing the source afterwards and since it's not a script anyway but hardcoded,

How can someone modify a GPLed piece of software and release it without 
providing access to the source code?


Post a reply to this message

From: Chris B
Subject: Re: getting some existing value as a variable
Date: 3 Sep 2009 17:09:02
Message: <4aa0306e@news.povray.org>
"clipka" <ano### [at] anonymousorg> wrote in message 
news:4aa017b6$1@news.povray.org...
> Mr schrieb:
>> Unfortunately, it's the exporter I'm using :( Blend2pov) a gpl version 
>> used to
>> exist but nobody has ported it to the current version of blender 2.49 
>> without
>> closing the source afterwards and since it's not a script anyway but 
>> hardcoded,
>
> How can someone modify a GPLed piece of software and release it without 
> providing access to the source code?

I would imagine it would have to be the original author/copyright holder, 
who is at liberty to relicense versions so long as the alternative licensing 
doesn't conflict with the rights that he's already given in perpetuity to 
use, modify and redistribute the original GPL'ed code.


Post a reply to this message

From: Mr
Subject: Re: getting some existing value as a variable
Date: 3 Sep 2009 19:10:00
Message: <web.4aa04bd7300e4d4fce00efe80@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
> "clipka" <ano### [at] anonymousorg> wrote in message
> news:4aa017b6$1@news.povray.org...
> > Mr schrieb:
> >> Unfortunately, it's the exporter I'm using :( Blend2pov) a gpl version
> >> used to
> >> exist but nobody has ported it to the current version of blender 2.49
> >> without
> >> closing the source afterwards and since it's not a script anyway but
> >> hardcoded,
> >
> > How can someone modify a GPLed piece of software and release it without
> > providing access to the source code?
>
> I would imagine it would have to be the original author/copyright holder,
> who is at liberty to relicense versions so long as the alternative licensing
> doesn't conflict with the rights that he's already given in perpetuity to
> use, modify and redistribute the original GPL'ed code.

He's not the original author of the code. But anyway... He's not ignoring
feedback.  He's the only one maintaining code synchronised with Blender CVS, so
I implicitly agreed to his terms. I just want to use whatever works.


Post a reply to this message

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