|
![](/i/fill.gif) |
Margus Ramst wrote:
>
> Isn't mesh2 converted to mesh internally?
> If so, does what you said still apply?
>
Actually, the syntax of mesh2 more closely resembles the internal
representation of the mesh object (in fact, it is almost exactly the same
as the internal representaion). And as was mentioned, the reason the
number of elements is required is for parsing reasons. One other option
is for the parser to read the mesh twice, only counting items the first
time. But, obviously, that would cause parse times to increase. Another
option would be to allocate space, then re-allocate if the first guess
was too big. Of course, you'd always have some extra allocated because
you probably wouldn't guess the exact amount. You could then re-allocate
an array of the exact size and copy the data, but that means having two
copies of the data in memory at parse time, which is not a good idea for
large meshes.
Finally, mesh2 (as indicated by Ron) was designed to be generated by
comptuters. Humans should probably still write using the original
mesh syntax.
P.S. Sorry I took so long to reply. I just moved to a new apartment and
the phone company took their time getting the phone working.
-Nathan
Post a reply to this message
|
![](/i/fill.gif) |