POV-Ray : Newsgroups : povray.binaries.images : Ocean : Re: Ocean Server Time
20 May 2024 08:17:34 EDT (-0400)
  Re: Ocean  
From: Cousin Ricky
Date: 8 Apr 2016 00:50:01
Message: <web.5707376e42d9a4ace5b326b50@news.povray.org>
Jaime Vives Piqueres <jai### [at] ignoranciaorg> wrote:
> El 07/04/16 a las 16:54, clipka escribió:
> > Then again, I must concede that this idea crumbles if the peaks
> > aren't perfectly sharp after all.
>
>    Well, the function heighfield I'm using is surely having flat
> triangles there. For perfectly sharp crests I guess I would have to use
> crazy resolutions.

If you test the function instead of the height field, that won't be a problem.

> > Let's take a step backward:
> >
> > What you want is foam at the crests, i.e. near local maxima.
> >
> > Local maxima can be identified by a zero 1st derivative (aka slope)
> > and negative 2nd derivative (aka curvature).
> >
> > It should be possible to analyze the f_ridged_mf() function in order
> > to construct the 1st and 2nd derivative functions, and use the
> > resulting functions as a basis for a foam pattern. (If you want to
> > avoid function analysis, you could still design functions for the
> > slope and curvature that effectively take samples from the original
> > function.)
> >
>
>    :O ...that's a too advanced approach for me: I barely passed maths at
> school.

My instinct would be to avoid the analysis approach, and do sampling on the
original function.  That doesn't take a lot of sophisticated math.  I can't even
remember the chain rule without looking it up (and the last time I did so was,
like, 2005), but I have used sampling to estimate normals on a form based on
parametric functions.  I did this for the smooth triangles of the elliptical
toroids in RoundEdge.  Normals, of course, can be easily converted to slopes.

Sampling won't get you the 2nd derivative, but it will tell you whether it's
positive or negative, which is enough for clipka's plan.


Post a reply to this message

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