POV-Ray : Newsgroups : povray.advanced-users : Spherical isosurface : Re: Spherical isosurface Server Time
18 Apr 2024 22:25:45 EDT (-0400)
  Re: Spherical isosurface  
From: Mike Horvath
Date: 29 Nov 2016 15:59:10
Message: <583dec1e@news.povray.org>
On 11/29/2016 3:04 PM, Bald Eagle wrote:
> Mike Horvath <mik### [at] gmailcom> wrote:
>
>>> What would be a formula for a sphere? L should be latitude, H longitude,
>>> and C radius.
>
> https://en.wikipedia.org/wiki/Spherical_coordinate_system
> Conversely, the Cartesian coordinates may be retrieved from the spherical
> coordinates
>
https://wikimedia.org/api/rest_v1/media/math/render/svg/d7bcd516d317c31ac48ed36e2ead9537a5f16e2e
>
>> Problem: L ranges from 0..100, and C ranges from 0..128, and I want to
>> avoid generating a flattened ellipsoid.
>>
>> Mike
>
> #declare C = C*(100/128);
>
>

THANK YOU!!

This had what I needed:

https://en.wikipedia.org/wiki/Spherical_coordinate_system#Cartesian_coordinates


I'm not sure I'm 100% correct, but here are my calculations:

#declare fD = function(C) {abs(C-0.5)-0.5}
#declare fDist = function(Dr,Dg,Db) {max(Dr,Dg,Db)}
#declare fR = function(L,C,H) {convertLCH2RGBa1(L,C,H)}
#declare fG = function(L,C,H) {convertLCH2RGBa2(L,C,H)}
#declare fB = function(L,C,H) {convertLCH2RGBa3(L,C,H)}
#declare fL = function(x,y,z) {acosd(y/sqrt(x*x+y*y+z*z))/180*100}
#declare fC = function(x,y,z) {sqrt(x*x+y*y+z*z)*128}
#declare fH = function(x,y,z) {atan2d(z,x)}

#declare fFinal = function(L,C,H)
{
	fDist
	(
		fD(fR(L,C,H)),
		fD(fG(L,C,H)),
		fD(fB(L,C,H))
	)
}


I just wish the results were more interesting.


Mike


Post a reply to this message


Attachments:
Download 'cielch_color_solid_sphere_isosurface_light.png' (61 KB)

Preview of image 'cielch_color_solid_sphere_isosurface_light.png'
cielch_color_solid_sphere_isosurface_light.png


 

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