|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
|
|