POV-Ray : Newsgroups : povray.general : Possible BUG in function-handling (V3.5) Server Time
5 Aug 2024 16:10:59 EDT (-0400)
  Possible BUG in function-handling (V3.5) (Message 1 to 8 of 8)  
From: jansb000
Subject: Possible BUG in function-handling (V3.5)
Date: 13 Aug 2002 08:36:16
Message: <3d58fd40@news.povray.org>
Information:
POVRAY-version: 3.5
OS: WinXP
System: P4/2Ghz, 512 MB DDR

Bug-description:
In version [POVRAY 3.5.icl.win32] this construction does not work:

#declare my_circle_centre = <1.1, 2.2, 3.3>;
#declare my_fun =
function(v) {
   my_circle_centre.x  + v
}
// my_circle_centre.x is not recognised as a float.

I think that my_circle_centre.x should be treated as a float.


Post a reply to this message

From: ABX
Subject: Re: Possible BUG in function-handling (V3.5)
Date: 13 Aug 2002 08:44:40
Message: <mivhlukti4quelqgkdort6ctvuab7e2819@4ax.com>
On Tue, 13 Aug 2002 14:36:16 +0200, "jansb000" <jan### [at] planetnl> wrote:
> I think that my_circle_centre.x should be treated as a float.

That's design. You can't access vector components in function the same way as
in rest of sdl. They are reserved for vector/color functions.

ABX


Post a reply to this message

From: Christoph Hormann
Subject: Re: Possible BUG in function-handling (V3.5)
Date: 13 Aug 2002 08:47:51
Message: <3D58FFF7.C627E386@gmx.de>
jansb000 wrote:
> 
> [...]
> 
> #declare my_circle_centre = <1.1, 2.2, 3.3>;
> #declare my_fun =
> function(v) {
>    my_circle_centre.x  + v
> }
> // my_circle_centre.x is not recognised as a float.
> 
> I think that my_circle_centre.x should be treated as a float.

This is not a bug but a known limitation.  It's probably possible to add
support for this but it isn't really necessary, just use a float variable
to store the value of vector.x.

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

From: Thorsten Froehlich
Subject: Re: Possible BUG in function-handling (V3.5)
Date: 13 Aug 2002 10:01:52
Message: <3d591150$1@news.povray.org>
In article <3d58fd40@news.povray.org> , "jansb000" <jan### [at] planetnl> 
wrote:

> #declare my_circle_centre = <1.1, 2.2, 3.3>;
> #declare my_fun =
> function(v) {
>    my_circle_centre.x  + v
> }
> // my_circle_centre.x is not recognised as a float.
>
> I think that my_circle_centre.x should be treated as a float.

No, this is a cureent design limitation that cannot easily be eliminated
completely in 3.5 but will go away in POV-Ray 4.0.

For now, use casting, i.e. like this will help:

#macro Const(theconst)
    #local retconst = theconst;
    retconst
#end

#declare my_fun = function(v)
{
    Const(my_circle_centre.x)  + v
}

Just like the other solutions proposed in this thread it will parse a bit
slower but have no (negative) effect on the function's speed.

    Thorsten

____________________________________________________
Thorsten Froehlich
e-mail: mac### [at] povrayorg

I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: ian badcoe REMOVE
Subject: Re: Possible BUG in function-handling (V3.5)
Date: 14 Aug 2002 10:48:50
Message: <3d5a6b19.22903313@news.povray.org>
Possibly related to this, if I do:

#declare tlv = function(px, py, pz, dir) {
  <1, 2, 3>
}

I get:

Parse Error: Expected 'operand', < found instead

it seems to be similar whatever kind of float expression is in the
"<>".  And using "<>" in the concrete argument lists of a built-in or
user-defined function is the same.

This is POV 3.5 on a fully-patched win2k machine.

Ian B


Post a reply to this message

From: ABX
Subject: Re: Possible BUG in function-handling (V3.5)
Date: 14 Aug 2002 11:23:23
Message: <oatklukc8jgltd1a96gbclmk8teop7r70d@4ax.com>
On Wed, 14 Aug 2002 14:41:55 GMT, ian### [at] yahoocouk wrote:
> Possibly related to this, if I do:
>
> #declare tlv = function(px, py, pz, dir) {
>   <1, 2, 3>
> }

Would you like to point part of documentation where such syntax is allowed ?

ABX


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Possible BUG in function-handling (V3.5)
Date: 14 Aug 2002 11:28:24
Message: <3d5a7718$1@news.povray.org>
In article <3d5a6b19.22903313@news.povray.org> , 
ian### [at] yahoocouk  wrote:

> Possibly related to this, if I do:
>
> #declare tlv = function(px, py, pz, dir) {
>   <1, 2, 3>
> }
>
> I get:
>
> Parse Error: Expected 'operand', < found instead
>
> it seems to be similar whatever kind of float expression is in the
> "<>".  And using "<>" in the concrete argument lists of a built-in or
> user-defined function is the same.
>
> This is POV 3.5 on a fully-patched win2k machine.

You are joking, right?

This absolutely never was supported!  And the documentation is absolutely
clear about vectors not being supported inside functions.  It is absolutely
impossible to miss this when reading the documentation about this feature.

So either you are joking or you should really RTFM!

    Thorsten

____________________________________________________
Thorsten Froehlich
e-mail: mac### [at] povrayorg

I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: ian badcoe REMOVE
Subject: Re: Possible BUG in function-handling (V3.5)
Date: 15 Aug 2002 08:32:51
Message: <3d5b993c.14703782@news.povray.org>
On Wed, 14 Aug 2002 17:28:22 +0200, "Thorsten Froehlich"
<tho### [at] trfde> wrote:

Oops, sorry.

For the return values I had just mis-remembered what was allowed.

But I hadn't understood the complete absence of vectors inside
functions, at all.  I just read 6.1 through again and I had completely
miss-read  the intended meaning of that first paragraph.  I would have
got it if I'd cross-referenced with the little parse-spec, but since
I'd already got the wrong idea, I didn't think to do that.

Sorry folks, I guess I'll go back to writting my vector expressions
out in long hand again....

>In article <3d5a6b19.22903313@news.povray.org> , 
>ian### [at] yahoocouk  wrote:
>
>> Possibly related to this, if I do:
>>
>> #declare tlv = function(px, py, pz, dir) {
>>   <1, 2, 3>
>> }
>>
>> I get:
>>
>> Parse Error: Expected 'operand', < found instead
>>
>> it seems to be similar whatever kind of float expression is in the
>> "<>".  And using "<>" in the concrete argument lists of a built-in or
>> user-defined function is the same.
>>
>> This is POV 3.5 on a fully-patched win2k machine.
>
>You are joking, right?
>
>This absolutely never was supported!  And the documentation is absolutely
>clear about vectors not being supported inside functions.  It is absolutely
>impossible to miss this when reading the documentation about this feature.
>
>So either you are joking or you should really RTFM!
>
>    Thorsten
>
>____________________________________________________
>Thorsten Froehlich
>e-mail: mac### [at] povrayorg
>
>I am a member of the POV-Ray Team.
>Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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