POV-Ray : Newsgroups : povray.advanced-users : Grid Interpolation? : Re: Grid Interpolation? Server Time
28 Jul 2024 14:19:00 EDT (-0400)
  Re: Grid Interpolation?  
From: Rune
Date: 17 Apr 2005 02:47:17
Message: <42620675$1@news.povray.org>
How about creating a bezier patch for each quad? Then the subdivision level 
can easily be controlled. And there are macros that take exactly a 2d array 
of points and create a bezier patch "cloth" from them, automatically 
creating all but the corner control points in the process (the corner points 
being the ones that comes from the original 2d array).

If you don't want to use POV-Ray's bezier patches, you can still use the 
algorithm used in bezier patches. I don't know if it really counts as a 
subdivision algorithm, but at least it creates a smooth surface while 
keeping the first set of nodes. Depending on how the control points for the 
bezier curves are calculated, it might or might not also keep the first set 
of normals. The method I use doesn't, but it seems to me like it's not that 
important here anyway, since you just calculate the normals from the points 
in the first place. Just think of it as the normals being calculated at a 
different stage in the process.

I know you like to code everything from scratch yourself. I don't remember 
if you even already have created macros for generating bezier patches from 
2d arrays yourself (I seem to vaguely remember that you have, but I might be 
wrong), but if not, there are macros out there to get inspiration from. I 
created some once that I still have lying around, in case you're interested.

Rune
-- 
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

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