POV-Ray : Newsgroups : povray.newusers : Newbie syntax problem Server Time
4 Sep 2024 22:14:22 EDT (-0400)
  Newbie syntax problem (Message 21 to 23 of 23)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Christopher James Huff
Subject: Re: Newbie syntax problem
Date: 12 Nov 2002 16:56:20
Message: <chrishuff-911ED4.16554312112002@netplex.aussie.org>
In article <3DD1354B.28FB473B@att.net>, LibraryMan <mrm### [at] attnet> 
wrote:

> Well, I haven't gotten around to learning to use/write macros yet;  I
> suspect much of the scene I'm working on could be done in more efficient
> ways, coding-wise, but I'm just not up to reinventing that wheel yet...
> ;-)

No need to reinvent any wheels, I posted a working version in another 
message.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Ken
Subject: Re: Newbie syntax problem
Date: 12 Nov 2002 21:00:45
Message: <3DD1B253.575E6908@pacbell.net>
Christopher James Huff wrote:
> 
> In article <3DD13CF9.CA8287AE@att.net>, LibraryMan <mrm### [at] attnet>
> wrote:
> 
> > Just a point of info I'd like to clarify (or maybe I shouldn't open this
> > can of worms):
> >
> > If I had declared only 2D vectors like so:
> > #declare v_01 = <0.5, 0>;  ... (rather than the 3D I used)
> 
> I think this is the main problem...POV doesn't seem to support declared
> 2D vectors, it seems to promote them to 3D. A language oddity that
> probably isn't worth fixing in 3.5, something to watch out for in 4.0.

Actually it was an intentional design decision. By design the program
presumes the user was brain damaged at the time he wrote the 2D vector
and corrects if for him rather than stopping and issuing an error message.
Microsoft calls such behavior "user friendly" :)

Should it be fixed, and if so in what way? There are only a couple of
places where a 2D vector statement is useful while there are dozens of
places where a 3D vector is mandatory. I think the current behavior
is useful and would support its continued use if asked to vote on it.

-- 
Ken Tyler


Post a reply to this message

From: Christopher James Huff
Subject: Re: Newbie syntax problem
Date: 12 Nov 2002 21:45:16
Message: <chrishuff-349F18.21444512112002@netplex.aussie.org>
In article <3DD1B253.575E6908@pacbell.net>, Ken <tyl### [at] pacbellnet> 
wrote:

> Should it be fixed, and if so in what way? There are only a couple of
> places where a 2D vector statement is useful while there are dozens of
> places where a 3D vector is mandatory.

Simple:
Assigning to a vector results in a vector of the same size as the 
original. If the "source" is too small, it is extended with 0's. (except 
for scalars, where every component of the resulting vector gets set to 
the scalar's value) If it is too big, it is truncated.
If something needs a 3D vector, it gets one, whether you give it a 
scalar, a 2D vector, or a 10D vector. If something needs a 2D vector, it 
gets one. The same for scalars, 4D vectors, 5D vectors...maybe POV could 
be changed to handle any size vectors, though some functions would still 
require specific sizes.

#declare scalar = 1; //scalar is a scalar value, one float
#declare vect2d = < 0, 0>; //vect2d is a 2D vector
#declare vect3d = < 0, 0, 0>; //vect3d is a 3D vector

scalar = < 1, 2> results in 1.
scalar = < 1, 2, 3> results in 1.

vect2d = < 1, 2, 3> results in < 1, 2>, maybe giving a warning.
vect3d = < 1, 2> results in < 1, 2, 0>.

vect2d = 3.14 results in < 3.14, 3.14>.
vect3d = 3.14 results in < 3.14, 3.14, 3.14>.

This is what I think anyone would expect from reading the existing 
documentation, and what seems most useful.


> I think the current behavior is useful and would support its 
> continued use if asked to vote on it.

What would you use the current behavior for? It seems unexpected that 
declaring a 2D vector results in a 3D vector, it requires workarounds to 
get the desired result, and I can't think of any time you would actually 
want it.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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