getVert using MXS, dotnet and C#

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 11 November 2013   #16
hehehe thanks anyway!
__________________
sinok.gr
 
Old 12 December 2013   #17
if you really want the fastest possible way to export mesh verts you'd be hard pressed to beat....

fwrite(mesh.verts, sizeof(Point3), mesh.numVerts, fstream);
 
Old 12 December 2013   #18
Originally Posted by Klunk: if you really want the fastest possible way to export mesh verts you'd be hard pressed to beat....

fwrite(mesh.verts, sizeof(Point3), mesh.numVerts, fstream);

it might be hard to believe but i found that many 'data access' operations are faster for MNMesh than for Mesh...
 
Old 12 December 2013   #19
you can write the entire mnmesh vert array in one call but you would have to read it back as (int, Point3, int) but it will be slower as it's a larger write.

fwrite(mnmesh.v, sizeof(MNVert), mnmesh.numv, fstream);


to have a continuous stream of vert positions you would have
to use...

    MNVert* verts = mnmesh.v;
    for(int i = 0; i < mnmesh.numv; ++i)
    	 fwrite(&verts[i].p,sizeof(Point3),1,fstream);


you could if were feeling adventurous go even lower level and use clever pointer math and write the bytes with system calls.

Last edited by Klunk : 12 December 2013 at 07:45 PM.
 
Old 12 December 2013   #20
in my case it was exactly iteration through all verts(normals) ... so i couldn't use a power of easy pointing to...
i really couldn't understand why the iteration through mnmesh data was faster for me than through mesh
 
Old 12 December 2013   #21
something like this might work

char* verts = &((char *)mnmesh.v)[4];
   for(int i = 0;i < mnmesh.numv; ++i, verts += sizeof(MNVert))
   	 _write(fd, verts, sizeof(Point3));


but you're looking at marginal gains if any. but i think the mesh
fwrite call would still just evaluate to

_write(fd, verts, sizeof(Point3) * numverts);


but without access to win32 fwrite source code who can say.

Last edited by Klunk : 12 December 2013 at 08:40 PM.
 
Old 12 December 2013   #22
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 02:44 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.