POV-Ray : Newsgroups : povray.binaries.images : pfeh : pfeh Server Time
7 Nov 2024 15:35:54 EST (-0500)
  pfeh  
From: Timothy Cook
Date: 15 Jul 2004 00:15:10
Message: <40f604ce@news.povray.org>
So much for that idea.  Spent a few weeks realizing I was
making things a few orders of magnitude harder than I needed,
came up with what *seemed* a viable solution...but it
obviously ain't.

So how DO I turn a sphere into a cube with an isosurface?
I was playing with the spherical heightfield idea, and
decided to start with a cube.  Simple enough, no?  No!  T_T

I started with two angles: heading and inclination.  For
ease of calculations, I decided to inscribe the cube in a
sphere with radius 1.  That is, the distance from the centre
of the cube to one of its corners would be 1 unit.  Pythagorean's
theorem gives the components of the line, 1=sqrt(x^2+y^2+z^2),
which would be at RA/decl(45, 45)...so a line from the centre of
the cube to the centre of any of the faces would be sqrt(1/3).
Focusing on only one face, we have a constant component (let's
use x) regardless of RA or decl on that face.  Y would be
sqrt(1/3)*tan(RA), and z would be sqrt(1/3)*tan(decl).  Plug
those into Pythagorean's theorem to get the distance from centre
of cube to point on surface at arbitrary location.  Multiply by
16,777,216 and convert to hex to get an RGB triplet.  Apply these
to an image map which is then used to deform a sphere isosurface.

Clearly, this is not a cube, and I would be needing the top and
bottom even if the sides were right.


-- 
Tim Cook
http://home.bellsouth.net/p/PWP-empyrean

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GFA dpu- s: a?-- C++(++++) U P? L E--- W++(+++)>$
N++ o? K- w(+) O? M-(--) V? PS+(+++) PE(--) Y(--)
PGP-(--) t* 5++>+++++ X+ R* tv+ b++(+++) DI
D++(---) G(++) e*>++ h+ !r--- !y--
------END GEEK CODE BLOCK------


Post a reply to this message


Attachments:
Download '2004-07-14 isotest.jpg' (51 KB)

Preview of image '2004-07-14 isotest.jpg'
2004-07-14 isotest.jpg


 

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