POV-Ray : Newsgroups : povray.binaries.animations : Planetary fly-overs with height-fields : Re: Planetary fly-overs with height-fields Server Time
19 Apr 2024 12:06:50 EDT (-0400)
  Re: Planetary fly-overs with height-fields  
From: Tor Olav Kristensen
Date: 4 Dec 2020 05:30:00
Message: <web.5fca0f23a2e69bcba06e58590@news.povray.org>
Hi Yadgar

=?UTF-8?Q?J=c3=b6rg_=22Yadgar=22_Bleimann?= <yaz### [at] gmxde> wrote:
>...
> vertpos = height*<radians(sin(-longitude))*radians(cos(latitude)),
> radians(sin(latitude)), radians(cos(-longitude))*radians(cos(latitude))>

The code above seems wrong. Your vector should probably be calculated like this:

<
    cos(radians(latitude))*sin(radians(-longitude)),
    sin(radians(latitude)),
    cos(radians(latitude))*cos(radians(-longitude))
>

>...
> The faces are constructed this way:
>
> #declare a = 0;
> #declare c = 0;
> #while (a < ydim-1)
>    #declare b = 0;
>    #while (b < xdim-1)
>      #declare Faces[a*ydim+b]  = <a*res+b, a*res+b+1, (a+1)*res+b>;
>      #declare Faces[a*ydim+b+1] = <a*res+b+1, (a+1)*res+b+1, (a+1)*res+b>;
>      #declare c = c+2;
>      #declare b = b+1;
>    #end
>    #declare a = a+1;
> #end

Have you tested if the code above works as you intended ?

--
Tor Olav
http://subcube.com
https://github.com/t-o-k


Post a reply to this message

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