POV-Ray : Newsgroups : povray.binaries.images : POV-Earth thread : Re: POV-Earth thread Server Time: 9 Aug 2020 14:32:20 GMT
  Re: POV-Earth thread  
From: Bald Eagle
Date: 6 Jul 2020 00:00:00
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.


 // 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 +
   #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}
   #local Last = Current;
 pigment {rgb 0}

Post a reply to this message

Download 'cubesphere_uvgridmaker.png' (45 KB)

Preview of image 'cubesphere_uvgridmaker.png'


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