POV-Ray : Newsgroups : povray.general : Sphere with longitudes and latitudes? : Re: Sphere with longitudes and latitudes? Server Time
31 Jul 2024 10:19:03 EDT (-0400)
  Re: Sphere with longitudes and latitudes?  
From: Trevor G Quayle
Date: 8 Jan 2008 20:40:01
Message: <web.47842583a8d0eaa2ae8612c0@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
> "SharkD" <nomail@nomail> wrote in message
> > ... snip ...
> > I'd like the grid lines to exist /within/ the sphere, as well as on the
> > surface.
> > Currently, if I cut a corner away from the sphere, the cut-away portion is
> > completely opaque (dark green in this case, black if I use Trevor G
> > Quayle's
> > code).
> >
>
> Actually I think the grid lines do exist within the sphere and I suspect
> that this is why you get a green or black surface in your cut-away. If the
> cut surfaces align with a horizontal line (eg. latitude 0 degrees) and two
> of the longitudinal lines (e.g. 0 and 90 degrees) then you'll get the colour
> of the grid lines (assuming you apply the one texture to the whole object).
>
> One way of resolving that would be to shift the horizontal lines up by half
> the current separation and rotate the sphere around the vertical axis by
> half a segment. Another would be to specify an appropriate texture of your
> choice to the object doing the cutting. e.g. a displaced and rotated
> gridline texture combined with an onion texture to give you the concentric
> spheres.
>
> > It's a personal request. I'd like to replace the SVG image with a nicely
> > rendered one, as the SVG image was removed from an article for being "too
> > ugly"
> > (kind of a stupid reason to remove a diagram from an encyclopedia, but
> > anyway...).
> >
>
> If it's an ugliness problem then presumably you don't want to just reproduce
> something that's very similar to what you've got. Also, I agree with Nicolas
> that a rendered image with grid-lines wouldn't scale as well as a vector
> graphics image will, resulting in less clarity and potentially some of the
> lines disappearing as it gets scaled down or uneven thickening as it gets
> scaled up. You may want to consider keeping the lines from the existing SVG
> file overlayed on top of prettier bitmapped spheres.
>
> You could probably do smoothly graded spheres in POV-Ray using orthographic
> projection and only ambient lighting, but I thought it was also possible to
> do such colour grading in an SVG editor.
>
> Hope there's something in all that that's helpful.
>
> Regards,
> Chris B.

The grid lines do go all the way through.  What he is referring to is the
concentric layer lines.

This should be fairly easy to do.  A few notes:

1) The Longitudinal lines are fine, they are already a constant thickness
through.

2) The latitude lines are from a spherical map, so they will radiate to the
center as needed, but they aren't constant thickness.  better to replace them
with another object pattern made from appropriately sized and offset cones.

3) For the concentric layer lines, a simple onion pattern should suffice.

4) A note on offsetting though. In the image, the lines aren't at the quadrants,
but rather the colour grids are centered on them, all grid lines should be
shifted accordingly. (This is why you get solid black when cutting though the
quadrant)

5) Unfortunately you will get thicker lines at the the center axis from the skew
of the longitudinal lines.  This really can't be avoided if you want to maintain
a constant thickness in the planes.  Perhaps they could be stopped short of the
center axis to prevent this.

6) Regarding 5), perhaps you don't need the separating grid lines for the
graphic, just the colour stepping alone (or even a constant gradient)would work
best.  You could still highlight the cutout edges with black lines though (again
using an object pattern)

7) For the colour gradient, you could use a simple macro for the cells, however
you could also use the HSL->RGB functions I posted in a different thread (look
for the thread regarding colour spaces and colour interpolation).  These
functions can be used to create a continous gradient function or modified to
give a stepped gradient.

I already started throwing some of the stuff together and may be able to post
something tomorrow.

-tgq


Post a reply to this message

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