POV-Ray : Newsgroups : povray.text.scene-files : Mercator projection Server Time
22 Dec 2024 18:39:02 EST (-0500)
  Mercator projection (Message 1 to 3 of 3)  
From: Greg M  Johnson
Subject: Mercator projection
Date: 25 Nov 2002 16:45:58
Message: <3de29a16$2@news.povray.org>
mercatorbase contains the macro
merctest is an example of use.


Post a reply to this message


Attachments:
Download 'merctest.pov.txt' (2 KB) Download 'mercatorbase.pov.txt' (4 KB)

From: Tor Olav Kristensen
Subject: Re: Mercator projection
Date: 25 Nov 2002 20:40:02
Message: <web.3de2cd0940c56e9238149fba0@news.povray.org>
Greg M. Johnson wrote:
>mercatorbase contains the macro
>...

I just had a quick look at your macro.
And below are some comments for you.


1.
Good idea.


2.
I can't understand why you use these
kind of expressions:

pow(_AnyExpression_, 1)

Is there any reason why you cannot just
write _AnyExpression_ ?

Is it to avoid some kind of bug ?
Please explain.


3.
I think that it is wise to change all
those #declare expressions within the
macro to #local expressions.


4.
Note that the p0 variable is not used
inside your macro.


5.
Have you considered shortening your
code, e.g. by replacing this part:

#declare v0 = y;
#local tr1 = transform{rotate z*_ValueB_ rotate y*_ValueA_};
#declare vul = vtransform(v0, tr1);

by something along these lines:

#declare v0 = z; // or -z
#declare vul = vrotate(v0, <_ValueC_, _ValueD_, 0>);

?


Tor Olav


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Mercator projection
Date: 26 Nov 2002 08:53:49
Message: <3de37ced$1@news.povray.org>
Most design problems are due to my coding inefficiency.

However:

"Tor Olav Kristensen" <tor### [at] hotmailcom> wrote in message
news:web.3de2cd0940c56e9238149fba0@news.povray.org...
> 2.
> I can't understand why you use these
> kind of expressions:
>
> pow(_AnyExpression_, 1)
>
> Is there any reason why you cannot just
> write _AnyExpression_ ?
>
> Is it to avoid some kind of bug ?
> Please explain.
>

Yes, the bug that was introduced to the final release of 3.5.

I had forgotten that I'd left that code there.

My first draft had the macro proceed stepwise from say 0 to 360 or 0 to 180,
(for theta or phi).  Then I tried an artistic effect where I would have the
top of something be more spherical and less faceted and the bottom be more
faceted: hence a nonlinear stepwise increase in the angle.   And to do so, I
was forced to use pow(_AnyExpression_, 2) .   In going back to a linear
system, I just replaced the 2 with a 1 but forgot to delete the pow.

I would certainly not be offended it you rewrote this utility to be more
elegant and efficient.

Thanks for the consideration..............


Post a reply to this message

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