Wednesday, September 10, 2014

Recent curve interpolating process works for graphics related work (and other stuff)

    Not sure if anything of the potential application in a way, albeit providing some measure of control for curve generation.

    So the idea that I had goes along the lines of how to build a smooth curve, outside of using bezier curves.   Okay so it seems there are number of things that can be done here.  For instance, it seems maybe I could generate a random sample of points, I don't need to be perfect in sketching out a curve by hand, and then guesstimating coordinate values for a given domain and range.  From this I could then apply a higher order least squares approximation at least higher order than linear...which merely graphs a best fit line between random points drawn, and maybe providing something nice for drawn curvature.  Interpolation over small intervals might work if you kept your sample space small, the problem, however, here is curve instability.  Interpolating with higher order polys may make points fit, but you may have all sorts of squiggling and jostling of the curve wildly moving in between sample points.  Which then brings up the alternate choice method which is cubic spline approximation.  Here, in theory over large interval sets you could sketch out a curve and then piece wise from sample point set to set, guesstimate slope values for a drawn curve.  Ensuring the sample parameters change from cubic spline point to point approximation sets change the same, that is the sample position and first, second, or third derivative conditions remain the same at the sample point ensures point wise continuity for the curve generated.  Otherwise, this should look pretty smooth.

Another method that I've recently employed, albeit surrendering a bit of control on the curve, employs a method of scaling points on the curve.  Basically scaling the domain and range of the curve, while controlling over a shorter interval curve generation say between a given domain [0,1], and range [0,1].  Granted if you were working over larger domain sets [0,20] and something like [0,1] for a given normalized z range, re scaled curves would likely have relative to a 20 point sample cubic spline set have a similar look in general.  It seems you'd have a lot more precision in curve sampling and control in the later case, but if you needed to generate a curve really fast and have something roughly in the ball park of needs, you could simply re scale points on the original domain and range.  Which is what I did for producing satisfactory looking falloff (threshold) curves.  I'd mention under curve range re scaling methods, you'd generally want to have as many points as needed to resolve the geometry of the curve as necessary.  For instance, if we were limited to 20 points on the domain for scaling, then I'd use 20 sample points on the original domain [0,1] which is to say a step increment of 1/20, between neighboring sample points, so that under scaling transformation I'd have transformed from 0,1/20,2/20,3/20,...,1 to the domain of 1,2,3,..,20.  In theory what's nice here for the approximating function(s), means that you can provide as many points as necessary on the original non scaled domain for curve approximation on a given re scaled domain and range (depending on your 3D modeling software), meaning in theory we shouldn't lose as much resolution of the geometry of the curve (if we sample enough points), or in other words, with the approximation of a curve, we can build a larger sample set of points with an approximating function so that we can re scale the geometry while reducing loss in geometric resolution under scaling .

    What happens with geometric resolution when there is loss you might ask?  Well, if you have something like linear interpolating processes employed in your 3D modeling software, typically what will happen is that as you scale the geometry larger, it will appear less piece wise smooth from vertex to vertex on the surface geometry (you might have smoothing modifiers for shading that help get under the lower poly resolution problems for scaling transformations here), or in other words, you start to see more the straight lines running from vertex to vertex on the represented geometry with more visibly present piece wise higher order derivative discontinuities (non matching slope values for instance for left or right approaches to a given vertex)...that is a curve appearing a lot less smooth.  Obviously having more sample points, does also lead to potentially more graphics processing load since there is that much more data to be tracked in the process of re scaling geometry with more points, but, it seems you might be able some solution to balancing this?!

 Generally while the geometry of the curve is not invariant under this type of re scaling method, it still, produces smooth, and stable curvature.

Here's some added notes on this stuff

World Terrain Mosaics Mind mapping thoughts working with Unity game engines


No comments:

Post a Comment

Oblivion

 Between the fascination of an upcoming pandemic ridden college football season, Taylor Swift, and Kim Kardashian, wildfires, crazier weathe...