|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I am using version 3.5 of POVray for Windows and hit a snag when I couldn't
get a built in function to work.
It was the sgn() function. I got error messages that seemed to indicate
that it wasn't recognized as a function when it was parsed. It also wasn't
recognized as a keyword when using POVray's built-in editor (for Windows)
which colors recognized keywords.
I used only a simple statement such as: "#declare Value1=sgn(-3);".
Could someone help me verify if this is a bug or maybe a workaround if it is
or etc.
Thanks
Demevec
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Demevec" <lik### [at] msncom> wrote in news:3d528d2c@news.povray.org
> I used only a simple statement such as: "#declare Value1=sgn(-3);".
looks like bug IMHO
> Could someone help me verify if this is a bug or maybe a workaround if
> it is or etc.
#macro Mysgn(a)
#local r=0;
#if (a) #local r=a/abs(a); #end
r
#end
#declare a=Mysgn(-3);
#declare b=Mysgn(+3);
#declare c=Mysgn(0);
#debug concat( str(a,3,9)," ",str(b,3,9)," ",str(c,3,9),"\n")
--
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Demevec wrote:
>
> [...]
>
> I used only a simple statement such as: "#declare Value1=sgn(-3);".
>
> Could someone help me verify if this is a bug or maybe a workaround if it is
> or etc.
You need to add
#include "math.inc"
before using the sgn() function.
Christoph
--
POV-Ray tutorials, IsoWood include,
TransSkin and more: http://www.tu-bs.de/~y0013390/
Last updated 03 Aug. 2002 _____./\/^>_*_<^\/\.______
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <Xns### [at] 204213191226>,
"Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote:
> > I used only a simple statement such as: "#declare Value1=sgn(-3);".
>
> looks like bug IMHO
Not a bug, just a user misunderstanding, see the answer by Christoph. It
wasn't recognized as a function because it wasn't declared.
--
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Christoph Hormann" <chr### [at] gmxde> wrote in message
news:3D5### [at] gmxde...
>
>
> Demevec wrote:
> >
> > [...]
> >
> > I used only a simple statement such as: "#declare Value1=sgn(-3);".
> >
> > Could someone help me verify if this is a bug or maybe a workaround if
it is
> > or etc.
>
> You need to add
>
> #include "math.inc"
>
> before using the sgn() function.
I think we will see a good number of such question, as it's not very clear
in the doc if you get there by doing a search. Should it be added to the
VFAQ ?
Povingly,
Philippe
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Philippe Debar wrote:
>
> I think we will see a good number of such question, as it's not very clear
> in the doc if you get there by doing a search. Should it be added to the
> VFAQ ?
is part of the math.inc description. What's unclear about that?
Christoph
--
POV-Ray tutorials, IsoWood include,
TransSkin and more: http://www.tu-bs.de/~y0013390/
Last updated 03 Aug. 2002 _____./\/^>_*_<^\/\.______
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Christoph Hormann wrote:
> Hmm, searching for 'sgn' finds "7.10.1 Float functions and macros" which
> is part of the math.inc description. What's unclear about that?
That it is part of math.inc description. I find it far from obvious if
you do not know by hearth the doc's numbering system. (At least on Win
it is not obvious.)
Philippe
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Christoph Hormann <chr### [at] gmxde> wrote in
news:3D52E135.768AB19B@gmx.de:
> Philippe Debar wrote:
>>
>> I think we will see a good number of such question, as it's not very
>> clear in the doc if you get there by doing a search. Should it be
>> added to the VFAQ ?
>
> which is part of the math.inc description. What's unclear about that?
I had to go to the previous page to see it is in the math.inc description.
When you are a (confused) newbie, this is not obvious, it could have been
a page from the SDL (except for the macro stuff).
--
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
in news:3d52dc61$1@news.povray.org Philippe Debar wrote:
> Should it be added to the
> VFAQ ?
>
No,
see http://www.povray.org/working-docs/id000256.html#7_10_1
Better?
Ingo
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
ingo wrote:
>
> [...]
>
> see http://www.povray.org/working-docs/id000256.html#7_10_1
>
> Better?
Well, it will look a bit strange in the HTML Help tree view or in the
table of contents:
* 7.10 math.inc
- 7.10.1 math.inc - Float functions and macros
- 7.10.2 math.inc - Vector functions and macros
I think it's mainly a limitation of the HTML Help system that the chapter
headings are not visible on the subchapter pages.
Christoph
--
POV-Ray tutorials, IsoWood include,
TransSkin and more: http://www.tu-bs.de/~y0013390/
Last updated 03 Aug. 2002 _____./\/^>_*_<^\/\.______
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |