POV-Ray : Newsgroups : povray.binaries.images : The back of the Moon : Re: The back of the Moon Server Time
31 Jul 2024 04:21:16 EDT (-0400)
  Re: The back of the Moon  
From: Jörg 'Yadgar' Bleimann
Date: 26 Apr 2010 16:44:08
Message: <4bd5fb18@news.povray.org>
High!

geep999 wrote:

> That's interesting. I did experiment a bit with heightfields, but couldn't
> figure out how to wrap it onto a sphere.

What about defining an image_map pigment (preferably a "simple 
cylindrical map" with 2:1 edge ratio, otherwise you'll got ugly 
distortions toward the poles), probing the color value of each pixel 
with eval_pigment() and then calculate each vertex of the spherical 
mesh2 by this formula, with long being latitude (0 to 360) and lat being 
latitude (90 to -90):

[radius calculated from pixel's RGB values] * 
<sin(radians(-long))*cos(radians(lat)), sin(radians(lat)), 
cos(radians(-long))*cos(radians(lat))>

Note that long must be negative, otherwise you'll get a mirrored map!

See you in Khyberspace!

Yadgar


Post a reply to this message

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