POV-Ray : Newsgroups : povray.newusers : Only take a minute - 1 day later, math question : Re: Only take a minute - 1 day later, math question Server Time
30 Jul 2024 16:25:38 EDT (-0400)
  Re: Only take a minute - 1 day later, math question  
From: Phil Cook
Date: 31 Jan 2004 04:44:19
Message: <opr2mwbppampsiks@news.povray.org>
On Fri, 30 Jan 2004 15:19:01 -0500, Christopher James Huff 
<cja### [at] earthlinknet> wrote:

> In article <opr2k5x2xmp4ukzs@news.povray.org>,
>  Phil Cook <phi### [at] nospamdeckingdealscouk> wrote:
>
>> I'm trying to create a crescent moon shape as per the code below, which
>> took a bit longer than I thought and still has a couple of bugs:) I ran 
>> up
>> against a interesting problem I'll try and explain it in two dimensions:
>
> Well, a crescent moon is just a half lit sphere. The outline is a
> circle, and the shadow line an ellipse. In the real world there are
> things like perspective to consider...you can probably ignore those
> here, though you haven't said what you were using it for. I'm not really
> sure what you're doing with those cones, or what kind of 3D shape you're
> looking for...just render a half-dark sphere if you want an actual
> crescent moon. For a 2D shape, you could use a polygon, thin prism,
> difference of cylinders, etc...just make half a circle, and cut out an
> ellipse with a major radius equal to the circle radius.
>
>
>> Create a new circle with radius NewRadius such that when moved *from*
>> <-NewRadius,0> *to* <-MinorRadius, 0> points on the circumference pass
>> through points: <-MinorRadius,0>(obviously), <0,MajorRadius>,
>> <0,-MajorRadius>.
>
> Sounds like you might be talking about a cycloid:
> http://mathworld.wolfram.com/Cycloid.html
>
> You want one "hump" of a cycloid with the ends at each point of a
> half-circle, and the peak at the peak of a smaller circle centered in
> the larger one? That doesn't really match what you describe, but it's
> the only way I can think of to get a crescent shape from a cycloid and
> circles.
>

I was messing with a logoey-type background and originally did it in a 2D 
paint package but it looked way too flat even with lighting effects so I 
thought I'd knock one up in POV; shouldn't take long :)

I was trying to sort-of make one of those crescent-moon pendants.Flat-base 
with a straight 45 degree slope up and then a flat internal 45 degree 
slope down, the end points of the crescent ending at the base level, hence 
the use of cones over spheres*. The problem was if I just use an upside 
down cone for the internal curve; although from a straight on perspective 
and shadowless it looks fine, different angles and shadows reveal it's not 
joined at the 'points' of the crescent. Which means tilting the internal 
cone to join the points; which means the slope is no longer 45 degrees; 
which means recalculating the radii of the cones, which is where it got 
fun.

I've pretty much got it working now, although the internal crescent 
doesn't *quite* join the external one at all points it's close enough not 
to be barely noticable.

Thanks for taking the time to try to help, I'm sure there's probably a 
much easier way to do this; as if there's a hard way and a easy way: I'm 
bound to take the hard way first :)

--
Phil

*I would still end up needing to calculate the center of a sphere using 
four points in order to get the right sizes and angles which sounds like 
even more fun :).
-- 
All thoughts and comments are my own unless otherwise stated and I am 
happy to be proven wrong.


Post a reply to this message

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