POV-Ray : Newsgroups : povray.binaries.images : Strange results when averaging normals on a spherical mesh2 : Strange results when averaging normals on a spherical mesh2 Server Time
8 Aug 2024 14:17:41 EDT (-0400)
  Strange results when averaging normals on a spherical mesh2  
From: Jörg 'Yadgar' Bleimann
Date: 15 Jun 2005 15:49:01
Message: <42b0862d@news.povray.org>
High!

(see also code files on p.b.s-f!)

After some delay, I finally found out how mesh2s and smooth_triangles 
work - starting with a hand-coded 5 by 5 mesh, whose smoothed version 
looks convincing at least to me (both non-smoothed and smoothed version 
attached here).

But then I also tried this on the curved mesh2 (following Earth 
curvature) from the 1200 by 1200 SRTM data of some mountainous Afghan 
wilderness west of Kabul... and got a VERY strange appearance of the 
mesh (also attached).

Not only that most of the topography is lost to a strange regular normal 
pattern, but also from about row 1100, normals are no longer averaged 
any more (#warning output "division by zero", vector "norm" keeps its 
initialization value of <0, 0, 0>), so that the foreground remains 
unsmoothed!

What went wrong?

Am I, at all, right to assume that the average of vectors
<x1, y1, z1>, <x2, y2, z2>,...,<xn, yn, zn> simply is
<(x1+x2+...+xn)/n, (y1+y2+...+yn)/n, (z1+z2+...+zn)/n> - or am I barking 
  up a totally wrong tree?

Another question, going much further into possible methods of 3D terrain 
modeling: as meshes (as well as heightfields) aren't really the golden 
road to photorealistic terrains based on real elevation data, I thought 
about computing an approximating function for each data column and row 
respectively and then "cross-approximating" somehow these two arrays of 
functions (in my case, each containing 1200 functions) in to one 
incredible complex function describing the whole data matrix as an 
isosurface.

Has such an algorithm ever been programmed, perhaps even in the POV 
world? I don't think of the hf_mesh_isosurface functions by Chistoph 
Hormann et al. (which just generate one function for each data point), 
but a solution which yields really smooth isosurfaces out of data 
matrizes...

See you in Khyberspace!

Yadgar

Now playing: Le Parc (Tangerine Dream)


Post a reply to this message


Attachments:
Download 'mesh2test.jpg' (9 KB) Download 'mesh2test_smoothed.jpg' (8 KB) Download 'sarehelmand_smooth.jpg' (49 KB)

Preview of image 'mesh2test.jpg'
mesh2test.jpg

Preview of image 'mesh2test_smoothed.jpg'
mesh2test_smoothed.jpg

Preview of image 'sarehelmand_smooth.jpg'
sarehelmand_smooth.jpg


 

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