POV-Ray : Newsgroups : povray.newusers : creating a surface from a matrix : Re: creating a surface from a matrix Server Time
4 Jul 2024 14:58:27 EDT (-0400)
  Re: creating a surface from a matrix  
From: Warp
Date: 30 Sep 2010 10:26:19
Message: <4ca49e0b@news.povray.org>
Colaroid <nomail@nomail> wrote:
> Has anybody any idea of how this can be done? Ideally, I would like to just
> refer to the ascii file using "quote marks" and not have to type (or cut and
> paste) the data into the POVRAY file.

  Are the values in the file single values, which would be interpreted as
heights? In that case it might be easier to create a 512x512-pixel grayscale
image from those values using an external program, and then in POV-Ray
creating a heightfield from the image.

  If the values are three-dimensional points, it would still be possible
to create a smooth surface from them, all from within POV-Ray itself, but
it would require a fair amount of SDL coding.

  The idea would be to create a bicubic patch for each set of 4 adjacent
points in the input data. The corners of the bicubic patch would, naturally,
be the points in the input data directly. The remaining 12 inner control
points of the bicubic patch can then be chosen such that the patch will
form a smooth surface with adjacent patches. This can be done by making
each patch edge control point form a straight line with the equivalent
edge control point of the adjacent patch. The direction of this line could
be parallel to the line that goes through the surrounding input data points.

  (I know this is a complicated thing to explain in words only, and would
require a visualization, but I'd go to further detail only if you or someone
else really needs the info.)

-- 
                                                          - Warp


Post a reply to this message

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