POV-Ray : Newsgroups : povray.binaries.images : POV-Earth thread : Re: POV-Earth thread Server Time
2 May 2024 04:40:24 EDT (-0400)
  Re: POV-Earth thread  
From: Bald Eagle
Date: 5 Jul 2020 20:00:00
Message: <web.5f02688e5d69181bfb0b41570@news.povray.org>
So, I'm trying to take the face subdivisions from a QuadSphere and uv-unwrap
them so I can overlay it on an image map.

I tried generating cartesian corner vertices, converting to spherical
coordinates, and then just plotting those theta and phi angles on the x and y
with  faux-sphere-sweeps for the horizontal and vertical coordinates, and got
some odd results.

Apparently Blender has some sort of add-on / plugin to do this with a mercator,
but I couldn't heads or tails of the code --- yet.



https://blender.stackexchange.com/questions/3315/how-to-get-perfect-uv-sphere-mercator-projection





 // Draw Horizontal Lines
 union {
 #for (Y, 0, faceResolution)
  #for (X, 0, faceResolution, Smoothness)
   #local Percent = <X/(faceResolution), Y/(faceResolution)>;
   #local pointOnUnitCube = upVector + (Percent.x-0.5)*2*AxisA +
(Percent.y-0.5)*2*AxisB;
   #local pointOnUnitSphere = Remap (pointOnUnitCube);
   #local Vertex = pointOnUnitSphere*PlanetRadius;
   #local LL = C2S (Vertex);
   #local CurrentNS = LL.x/90;
   #local CurrentEW = LL.y/180;
   #local Current = <CurrentEW*S, CurrentNS*S-HalfY, 0>;
   #debug concat ( "Current = ", vstr(3, Current, ", ", 3, 3), " \n")
   sphere {Current, Line}
   sphere {Vertex, Line}
   #if (X > 0)
    cylinder {Last, Current Line}
   #end
   #local Last = Current;
  #end
 #end
 pigment {rgb 0}
 }


Post a reply to this message


Attachments:
Download 'cubesphere_uvgridmaker.png' (45 KB)

Preview of image 'cubesphere_uvgridmaker.png'
cubesphere_uvgridmaker.png


 

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