View Single Post
Old 18th March 2004, 10:56 PM   #1
monster
Member
Advanced member
 
Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 39
Default Adding lots of surfaces quickly - Importer plugin

Hi Folks,

What's the quickest way to add a lot (like 250,000 or so) surfaces to an AC3D object in an importer plugin.

Currently I use something like;
Code:
List *surfaces = NULL;
...
Surface* s = new_surface();
// Set up surface
list_add_item_head(&surfaces,s);
...
object_add_surfaces(object,surfaces);
But it seems that list_add_item[_head] is relatively slow and gets slower the more surfaces I add.

Is there something like ac_object_add_vertices_from_float_array, but for surfaces that would let me pre-allocate a bunch of surfaces and add them to my object all in one hit?

Cheers.
monster is offline   Reply With Quote