|
|
Mr schrieb:
> Hmm... but how can I find the right vertices pairs in such an output mesh:
>
>
> vertex_vectors {1108,<-0.0582308,0.879374,-0.00541553>,[ETC...] }
> normal_vectors {1108,<-0.489174,-0.0570892,0.870316>,[ETC...]}
> face_indices {2208,<0,1,2>,<2,3,0>,<4,5,6>,<6,7,4>,<8,9,10>,<11,12,13>,[ETC...]
> normal_indices { 2208,<0,1,2>,<2,3,0>,<4,5,6>,<6,7,4>,<8,9,10>,[ETC...]}
>
>
> (I don't get why there are face indices whereas the mesh is only edges but
> anyway...)
POV-Ray *only* has "faced" meshes; there's nothing it can do (natively)
with edges anyway. Therefore of course the program you used to design
the mesh with assumed you wanted a "faced" mesh when it exported to
POV-Ray format.
> Should I assume that vertices are exported consecutively on a same
> edgeloop? Since I have a constant n number of verts over these edgeloops should
> I chop these coordinates by such amounts of n vectors to use in spheresweeps?
No, what you'll actually need to do is traverse the list of faces,
connecting the vertices with edge cylinders as you go along, and make
sure to deal with duplicates (each edge will typically be listed twice)
by either:
(a) build an edge list from the face definitions, checking for each
additional edge whether you already encountered it (can quickly become
quite parsing-heavy)
(b) rely on the mesh comprising a closed surface (no "open faces"), and
be "sane" regarding inside/outside orientation (which is defined by the
order in which the vertices are listed), so that each edge appears
exactly twice, with opposite ordering of vertices; you can then draw the
edge only if the first vertex index is lower than the second (or vice
versa, at your discretion)
(c) ignore the problem of duplicate vertices, and simlpy add the
respective cylinder twice; if they have the same texture, there
shouldn't be a problem regarding coincident surface artifacts.
Post a reply to this message
|
|