POV-Ray : Newsgroups : povray.general : Surface from XYZ data : Surface from XYZ data Server Time
30 Jul 2024 16:21:11 EDT (-0400)
  Surface from XYZ data  
From: New2Povray
Date: 14 Oct 2008 14:25:00
Message: <web.48f4e301fc37f40429569840@news.povray.org>
Hi all

I am new to povray and have been trying to render a surface without much
success, the surface could not be mathematically represented (will at least not
in one piece) as a function, but I do have the x, y, and z data. How do I go
about rendering this in povray? Joining up bicubic patch objects should work
but I do have a large number of points, the mesh grid is a square one if that
helps. To give an example, say the following is a portion of the surface I want
to render (a saddle point of Z=sin(X*Y). Could anyone point to to the right
direction or give me some sample code to study?

With thanks

>> X

X =

   -1.5000   -1.0000   -0.5000         0    0.5000    1.0000    1.5000
   -1.5000   -1.0000   -0.5000         0    0.5000    1.0000    1.5000
   -1.5000   -1.0000   -0.5000         0    0.5000    1.0000    1.5000
   -1.5000   -1.0000   -0.5000         0    0.5000    1.0000    1.5000
   -1.5000   -1.0000   -0.5000         0    0.5000    1.0000    1.5000
   -1.5000   -1.0000   -0.5000         0    0.5000    1.0000    1.5000
   -1.5000   -1.0000   -0.5000         0    0.5000    1.0000    1.5000

>> Y

Y =

   -1.5000   -1.5000   -1.5000   -1.5000   -1.5000   -1.5000   -1.5000
   -1.0000   -1.0000   -1.0000   -1.0000   -1.0000   -1.0000   -1.0000
   -0.5000   -0.5000   -0.5000   -0.5000   -0.5000   -0.5000   -0.5000
         0         0         0         0         0         0         0
    0.5000    0.5000    0.5000    0.5000    0.5000    0.5000    0.5000
    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000
    1.5000    1.5000    1.5000    1.5000    1.5000    1.5000    1.5000

>> Z

Z =

    0.7781    0.9975    0.6816         0   -0.6816   -0.9975   -0.7781
    0.9975    0.8415    0.4794         0   -0.4794   -0.8415   -0.9975
    0.6816    0.4794    0.2474         0   -0.2474   -0.4794   -0.6816
         0         0         0         0         0         0         0
   -0.6816   -0.4794   -0.2474         0    0.2474    0.4794    0.6816
   -0.9975   -0.8415   -0.4794         0    0.4794    0.8415    0.9975
   -0.7781   -0.9975   -0.6816         0    0.6816    0.9975    0.7781


Post a reply to this message

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