comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: triangulate proc
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: triangulate proc [message #21900] Thu, 28 September 2000 00:00
Sylvain Carette is currently offline  Sylvain Carette
Messages: 19
Registered: May 2000
Junior Member
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
correction below
<p>Sylvain Carette wrote:
<blockquote TYPE=CITE><tt>Hi</tt>
<br><tt>Still trying to make sense of TRIANGULATE using the "SPHERE=S"
variable</tt>
<br><tt>as a simple example (can all be done from cut &amp; paste to the
command line):</tt>
<br><tt>lon = RANDOMU(seed, 50) * 360. - 180.</tt>
<br><tt>lat = RANDOMU(seed, 50) * 180. - 90.</tt>
<br><tt>z = dblarr(50)</tt>
<br><tt>z[*] = 500</tt>
<br><tt>TRIANGULATE, lon, lat, tri, fvalue=z, sphere=s, /degrees</tt>
<p><tt>Printing help, s , /structure&nbsp; give:</tt>
<p><tt>XYZ&nbsp;&nbsp;&nbsp; FLOAT&nbsp;&nbsp;&nbsp; Array[50, 3]; note
the inconsistency of the vertice format</tt>
<br><tt>IEND&nbsp;&nbsp;&nbsp; LONG&nbsp;&nbsp;&nbsp; Array[50]</tt>
<br><tt>IADJ&nbsp;&nbsp;&nbsp; LONG&nbsp;&nbsp;&nbsp; Array[300]</tt>
<p><tt>Converting back the vertice to xyz form (array[3, 50]) and feeding
to IDLgrPolygon with style=0 (point) show that the vertice effectively
are plotted onto the surface of a sphere:</tt>
<p><tt>xyz = transpose(s.xyz)</tt>
<br><tt>oTin = OBJ_NEW('IDLgrPolygon', xyz, STYLE=0)</tt>
<br><tt>xobjview, oTin</tt>
<p><tt>Now a matter of making sense of the connectivity; if I feed "tri"
to IDLgrPolygon its a mess (I've seen worse but still not right) - note
that "tri" is a LONG array[3, 96]:</tt>
<p><tt>oTin = OBJ_NEW('IDLgrPolygon', xyz, polygons=tri, STYLE=1)</tt>
<br><tt>xobjview, oTin</tt>
<p><tt>Now what do represent the IEND and IADJ (I might guess its indexend
and indexadjacency but else) array and how to use them effectively? any
sample around?</tt>
<br><tt>Printing those two array just make things more confusing; I would
guess IEND is used to "segment" IADJ but: 5 9 15 21 27 32 38 46 ... etc
up to just below 300 doest look like that while printing IADJ begin with
what seem a triangle index - 2 8 4 7 5 3 8 1 5 8 2 5 ... whithin the 50
vertice range, the last line is suddenly fill of completely out of range
values like 1129665108!?!?</tt>
<p><tt>Looking at IADJ[&lt;last value in IEND-1 = 287>] show that it is
the last valid value before out of range values (so maybe IEND *might*
be a kind of array segmentation...).</tt>
<br><tt>So I "reform" the array:</tt>
<p><tt>adjj = reform(s.adj, 3, (288/3))</tt></blockquote>
<tt>should be:</tt>
<br><tt>adjj = reform(s.adj, 3, (n_elements(s.adj[0:287])/3))</tt>
<blockquote TYPE=CITE><tt></tt>&nbsp;
<br><tt>So I got: adjj[3, 96]&nbsp; -- Hey, that begin to look like it....</tt>
<p><tt>Have to do also "adjj = adjj-1" since all the indexes values were
offset +1 -- that is 1 to 50 instead of 0 to 49 (?!?!again).. skipping
lot of error message here....</tt>
<p><tt>End up feeding again IDLgrPolygon with this adjj as parameter to
"polygons=" but this time error "invalid connectivity"... duh..</tt>
<br><tt>So here I'm I........ begin to have exhausted all the guessing
I could (I would like to try something based on some doc or fact but didnt
find any) and also I do not like to do programming by guessing....</tt>
<br><tt>Anybody have some ideas?</tt>
<p><tt>Thanks in advance</tt>
<p><tt>Sylvain Carette</tt>
<br><tt>VRML designer-composer</tt></blockquote>
</html>
[Message index]
 
Read Message
Previous Topic: Re: Dos and Donts
Next Topic: Re: Draw widget mouse position error - follow up

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:52:28 PDT 2025

Total time taken to generate the page: 0.00416 seconds