POV-Ray : Newsgroups : povray.general : 4d, 2d bugs in pov 3.1g?? Server Time
11 Aug 2024 07:17:00 EDT (-0400)
  4d, 2d bugs in pov 3.1g?? (Message 1 to 8 of 8)  
From: Greg M  Johnson
Subject: 4d, 2d bugs in pov 3.1g??
Date: 6 Sep 1999 16:04:53
Message: <37d41e65@news.povray.org>
I'm using the superpatch 3.1e with pov 3.1g.

I cannot normalize a 4d vector.  Is  there a bug or am I doing something
wrong?

#declare RRR=seed(2022) ;
#declare UMAX=1 ;
#declare
actorp[n]=UMAX*<rand(RRR)-0.5,rand(RRR)-0.5,rand(RRR)-0.5,rand(RRR)-0.5>;

#declare actorv[n]=vnormalize(actorp[n]);

Also, I'm getting some messages occasionally (after using the patch for
all of 5 minutes)  when trying to #write a 2d vector

#write
(MyFile2,"{",actorp[n].x,",",actorp[n].y,",",0,",",actorv[n].x,",",actorv[n].y,",",0,"}",",","\n")

It hung up at the "y", saying that it was a bad descriptor, or
something.  It didn't like a u & v setup either.  But then this problem
went away!!


Post a reply to this message

From: Nieminen Juha
Subject: Re: 4d, 2d bugs in pov 3.1g??
Date: 7 Sep 1999 01:07:53
Message: <37d49da9@news.povray.org>
"Greg M. Johnson" <"gregj;-)56590"> wrote:
: #write
:
(MyFile2,"{",actorp[n].x,",",actorp[n].y,",",0,",",actorv[n].x,",",actorv[n].y,",",0,"}",",","\n")

  This isn't an answer to the problem, but I'm just wondering that instead
of writing
",",0,"}",",","\n"
wouldn't it be easier to write just:
",0},\n"

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ron Parker
Subject: Re: 4d, 2d bugs in pov 3.1g??
Date: 7 Sep 1999 11:00:04
Message: <37d52874@news.povray.org>
On Mon, 06 Sep 1999 15:32:00 -0400, Greg M. Johnson wrote:
>I'm using the superpatch 3.1e with pov 3.1g.
>
>I cannot normalize a 4d vector.  Is  there a bug or am I doing something
>wrong?

Yes, it's either a bug or you're doing something wrong. :)

It's not really a bug, per se, but a limitation of the design.  POV really
only supports 4D vectors for use as colors.  Anything that wants a vector 
argument usually only wants a 3d vector.  I don't see anything being done
about this anytime soon.


Post a reply to this message

From: Greg M  Johnson
Subject: Re: 4d, 2d bugs in pov 3.1g??
Date: 7 Sep 1999 11:06:15
Message: <37D52952.3EACA058@my-dejanews.com>
Okay then, can you tell this quite ignorant user how to write a macro that
will compute the length of a 4d vector?
I know it's simply the square root of the sum of the squares of the individual
components.
I actually already tried it and think I ran into some error messages...


Ron Parker wrote:

> On Mon, 06 Sep 1999 15:32:00 -0400, Greg M. Johnson wrote:
> >I'm using the superpatch 3.1e with pov 3.1g.
> >
> >I cannot normalize a 4d vector.  Is  there a bug or am I doing something
> >wrong?
>
> Yes, it's either a bug or you're doing something wrong. :)
>
> It's not really a bug, per se, but a limitation of the design.  POV really
> only supports 4D vectors for use as colors.  Anything that wants a vector
> argument usually only wants a 3d vector.  I don't see anything being done
> about this anytime soon.


Post a reply to this message

From: Ron Parker
Subject: Re: 4d, 2d bugs in pov 3.1g??
Date: 7 Sep 1999 11:35:33
Message: <37d530c5@news.povray.org>
On Tue, 07 Sep 1999 11:03:46 -0400, Greg M. Johnson wrote:
>Okay then, can you tell this quite ignorant user how to write a macro that
>will compute the length of a 4d vector?
>I know it's simply the square root of the sum of the squares of the individual
>components.
>I actually already tried it and think I ran into some error messages...

I think you'll have to do something like
 
sqrt( V.red*V.red+V.green*V.green+V.blue*V.blue+V.filter*V.filter )

though I haven't tested it.


Post a reply to this message

From: Greg M  Johnson
Subject: Re: 4d, 2d bugs in pov 3.1g??
Date: 7 Sep 1999 11:58:27
Message: <37D5358C.B550EF6C@my-dejanews.com>
aha.  I think when I tried it last night, I was using .x, .y, .z, and .t.  Thanks,
will try your suggestion.

Ron Parker wrote:

> On Tue, 07 Sep 1999 11:03:46 -0400, Greg M. Johnson wrote:
> >Okay then, can you tell this quite ignorant user how to write a macro that
> >will compute the length of a 4d vector?
> >I know it's simply the square root of the sum of the squares of the individual
> >components.
> >I actually already tried it and think I ran into some error messages...
>
> I think you'll have to do something like
>
> sqrt( V.red*V.red+V.green*V.green+V.blue*V.blue+V.filter*V.filter )
>
> though I haven't tested it.


Post a reply to this message

From: Greg M  Johnson
Subject: Re: 4d, 2d bugs in pov 3.1g??
Date: 7 Sep 1999 12:04:28
Message: <37D536F7.3F6776EF@my-dejanews.com>
One more thing: how do I do this as a function or macro?

I also think I was getting some strange debug codes which suggested I had an extra

#;

showing up.  I honestly don't think I even know how to write a "function" macro
after reading the docs. I want to have my new 4d vlength macro be usable about 2 or
3 places, so I would like to avoid retyping the whole function again and again.
ALthough I've probably just now done more typing than I'm complaining about, it's
an inelegant and error-prone solution...

Ron Parker wrote:

> On Tue, 07 Sep 1999 11:03:46 -0400, Greg M. Johnson wrote:
> >Okay then, can you tell this quite ignorant user how to write a macro that
> >will compute the length of a 4d vector?
> >I know it's simply the square root of the sum of the squares of the individual
> >components.
> >I actually already tried it and think I ran into some error messages...
>
> I think you'll have to do something like
>
> sqrt( V.red*V.red+V.green*V.green+V.blue*V.blue+V.filter*V.filter )
>
> though I haven't tested it.


Post a reply to this message

From: Chris Huff
Subject: Re: 4d, 2d bugs in pov 3.1g??
Date: 7 Sep 1999 13:21:47
Message: <37D549F3.7B49EAEB@compuserve.com>
Just do this:
#macro vlength4d(V)
    (sqrt( V.red*V.red + V.green*V.green + V.blue*V.blue +
V.filter*V.filter ))
#end

The extra parenthesis should not be necessary, but I have had situations
before where they made a difference.


Post a reply to this message

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