POV-Ray : Newsgroups : povray.binaries.animations : Planetary fly-overs with height-fields : Re: Planetary fly-overs with height-fields Server Time
26 Apr 2024 08:31:51 EDT (-0400)
  Re: Planetary fly-overs with height-fields  
From: Jörg "Yadgar" Bleimann
Date: 5 Dec 2020 08:55:48
Message: <5fcb9164@news.povray.org>
Hi(gh)!

On 04.12.20 11:27, Tor Olav Kristensen wrote:
> 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))

Yes, you're right - I just typed it from memory, I should have looked it 
up in my scripts instead!

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

With the script I extracted the code from, it works perfectly!

See you in Khyberspace!

Yadgar


Post a reply to this message

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