POV-Ray : Newsgroups : povray.general : computed rotate in macros Server Time
12 Aug 2024 13:16:30 EDT (-0400)
  computed rotate in macros (Message 11 to 14 of 14)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: John M  Dlugosz
Subject: Re: computed rotate in macros
Date: 1 Mar 1999 23:06:24
Message: <36db63c0.0@news.povray.org>
That would be a way... concecutive rotate/translate and exotics (like shear
and perspecive distortions, which POV doesn't have primitives for) can be
collapsed into one "matrix".  However, a "matrix" with 16 parameters might
take more file space than a small number of rotate and translate commands.
So there is a break-even point.

And that might be a partial answer to my original question:  there is no
primitive to rotate the way I want, but I could use a POV matrix.

--John

Spider wrote in message <36DB3B43.43E150AF@bahnhof.se>...
>Thankyou.
>I'm actually looking for a way to reduce the filesize of my tree macro
creator,
>preferable by removing some of the rotate, into either a single one or into
a
>matrix. I'm uncertain what would be easiest for me to do. I don't intend to
do a
>big time recode for a small saving, but if I can do it with some ease, I
will.
>
>
>--
>//Spider
>( spi### [at] bahnhofse ) [ http://www.bahnhof.se/~spider/ ]
>#declare life = rand(seed(42))*sqrt(-1);


Post a reply to this message

From: Spider
Subject: Re: computed rotate in macros
Date: 2 Mar 1999 04:18:27
Message: <36DBAB72.5E598A1C@bahnhof.se>
I actually hope to save space with this, since there are three rotations in a
row, repeated some 3000 times in a .inc file. I know that POV doesn't take long
to compute it, but I'd still think it was a good idea to reduce them, for the
sake of filesize. the difference would not be as big with a matrix, since it
requires a few more numbers than a rotate, so perhaps a way to apply two rotates
in a single one. I still haven't worked on it, since I don't think I have the
skills required.


-- 
//Spider 
( spi### [at] bahnhofse ) [ http://www.bahnhof.se/~spider/ ]
#declare life = rand(seed(42))*sqrt(-1);


Post a reply to this message

From: John M  Dlugosz
Subject: Re: computed rotate in macros
Date: 2 Mar 1999 21:20:52
Message: <36dc9c84.0@news.povray.org>
Yes, two or three rotates can be turned into a single rotate.  But I'm not
certain that an arbitrary rotation can be expressed as a single POV rotate<>
argument.

To reduce the source filesize, why not use some macros?

Then again... (reading in a textbook) ... an arbitrary rotation can be
decomposed into five axis rotations.  Because one rotate<> command does
three such rotates (one on each axis), I can collapse that down to fewer
statements when consecutive rotates are performed in the proper order.  That
gives me three individual rotate commands.

So, an arbitrary rotation (any amount on any axis) can be expressed as three
rotate<> primitives in POV, or as one matrix primitive.

    rotate <0, 0, -theta>
    rotate <0, -phi, A>
    rotate <0,phi,theta>

where phi and theta are computed based on the desired axis of rotation, and
A is the amount to rotate along that axis.

--John

Spider wrote in message <36DBAB72.5E598A1C@bahnhof.se>...
>I actually hope to save space with this, since there are three rotations in
a
>row, repeated some 3000 times in a .inc file. I know that POV doesn't take
long
>to compute it, but I'd still think it was a good idea to reduce them, for
the
>sake of filesize. the difference would not be as big with a matrix, since
it
>requires a few more numbers than a rotate, so perhaps a way to apply two
rotates
>in a single one. I still haven't worked on it, since I don't think I have
the
>skills required.
>
>
>--
>//Spider
>( spi### [at] bahnhofse ) [ http://www.bahnhof.se/~spider/ ]
>#declare life = rand(seed(42))*sqrt(-1);


Post a reply to this message

From: Spider
Subject: Re: computed rotate in macros
Date: 2 Mar 1999 21:34:18
Message: <36DC9E38.2A2B99EB@bahnhof.se>
"John M. Dlugosz" wrote:
> 
> 
> To reduce the source filesize, why not use some macros?
because I try to get away from macros in this case, because the REALLY slow
parse time for them. and when I do this, I output to a .inc directly what the
macro would do, but it seemed that I should be able to reduce theese rotates to
a single one, thus reducing the filesize.

-- 
//Spider 
( spi### [at] bahnhofse ) [ http://www.bahnhof.se/~spider/ ]
#declare life = rand(seed(42))*sqrt(-1);


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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