|
 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
| High!
|
| Once again, like already in December 2003, I tried to render a
spherical
| mesh (to be precise, a small section of a spherical mesh, covering only
| one square degree) from a 1200 x 1200 ASCII matrix generated itself
from
| a SRTM GeoTIFF (needless to say what part of the world ;-)).
|
| I hoped that my new Athlon 64 2800+ would be able to cope with it...
but
| once again was disillusioned, after about 780 lines the parsing became
| so slow that it would have take millennia to parse the rest.
|
| Are there ways to speed things up? Christoph Hormann's HF_sphere macro
| would not be an alternative as it renders only complete spheres (unless
| there has been an update meanwhile, of which I don`t know yet), not
| sections.
|
How much RAM do you have on your computer? My bet is that it gets to
a point where you use too much memory and the computer starts to swap.
You could use a lot less memory by doing away with the mtrix arry and
using a mesh2 (and gain in computational complexity during parse at
the same time).
Try something like this (untested):
mesh2 {
~ vertex_vectors {
~ 1200*1200,
~ #fopen matr "e:\homepage\n34e068-b.txt" read
~ #declare a = 0;
~ #while (a < 1200)
~ #declare b = 0;
~ #while (b < 1200)
~ #read (matr, data)
~ <(re+data) * sin ((sLong-b/1200) * (pi/180)) *
~ cos ((sLat - a/1200) * (pi/180)),
~ (rp+mtrix[a][b])*sin((sLat-a/1200)*(pi/180)),
~ (re+data) * cos ((sLong-b/1200) * (pi/180)) *
~ cos ((sLat-a/1200)*(pi/180))>,
~ #declare b = b+1;
~ #end
~ #declare a = a+1;
~ #end
~ #fclose matr
~ }
~ face_indices {
~ 1199 * 1199 * 2,
~ #declare a = 0;
~ #while (a < 1199)
~ #declare b = 0;
~ #while (b < 1199)
~ <1200*a + b, 1200*a + b+1, 1200*(a+1) + b>,
~ <1200*a + b+1, 1200*(a+1) + b+1, 1200*(a+1) + b>,
~ #declare b = b+1;
~ #end
~ #declare a = a+1;
~ #end
~ }
~ texture {
~ pigment { color rgb <1, 0.5, 0> }
~ finish { F_Standard }
~ }
}
Jerome
- --
******************************
* Jerome M. Berger *
* mailto:jbe### [at] ifrance com *
* http://jeberger.free.fr/ *
******************************
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFCSxX6qIYJdJhyixIRAntZAJ9Psj1Xr7CsxU4LRgY28KfGwE00iwCffy5v
mGd6+/gyYQhhToVwZpqvBOE=
=y78+
-----END PGP SIGNATURE-----
Post a reply to this message
|
 |