;+ ; NAME: ; RemoteView_VertexSphere ; PURPOSE: ; Calulate the vertices for shading a sphere. ; CATEGORY: ; Skyview package ; CALLING SEQUENCE: PRO RemoteView_VertexSphere, nS, Vertex, Polygon ; INPUTS: ; nS scalar determines the resolution of the sphere. ; 25 is a reasonable value ; OUTPUTS: ; Vertex, Polygon ; arrays determined by IDL shade_volume procedure ; the vertices are points on the unit sphere, ; relative to the origin of the sphere. ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; gridgen ; PROCEDURE: ; Set up a 3D volume data array containing the distance ; to the sphere center. Then calculate the vertex and polygon arrays. ; The vertices usually need to be scaled to the appropriate size, and/or ; the origin needs to be shifted. ; MODIFICATION HISTORY: ; FEB-1998, Paul Hick (UCSD/CASS, pphick@ucsd.edu) ;- S = gridgen( (2*nS+1)*[1,1,1], range=(nS*[-1,1])#[1,1,1], /multid) S = total(S*S, 1) ; r^2 = x^2+y^2+z^2 x = 0.9*nS shade_volume, S, x*x, Vertex, Polygon Vertex = (Vertex-nS)/x ; Vertex coord of unit sphere ; .. relative to sphere center RETURN & END