Go Back   AC3D Forums > Technical > AC3D Developers
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 22nd July 2004, 10:39 PM   #1
Joerg
Junior Member
Junior member
 
Join Date: Jul 2004
Location: Australia
Posts: 7
Default best way to add lots of surfaces ?

Hi,

I'm currently working on an import plugin, but I seems to have quite some trouble to get good performance. So what's the best way to add surfaces ?

Just to give you some idea, a simple model might have the following structure:

World
Group 1
Object 1
Surfaces
Object 2
Surfaces
Group 2
Object 3
Surfaces
...

One problem is that each "Surface" could use a different texture.

In general all surfaces use a common vertex list, but there can be meshes which have there own list as well.

Thanks
Joerg is offline   Reply With Quote
Old 23rd July 2004, 04:21 AM   #2
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default

Code:
Prototype void object_add_surface_head(ACObject *ob, Surface *p);
will add it to the start of the list - very fast. (the order of the surfacelist is generally unimportant)

If you already have a list of surfaces, use this:

Code:
Prototype void object_add_surfaces(ACObject *ob, List *l);
(this simply calls object_add_surface_head for each item on the list).

the _head functions will always be faster.

Remember that vertices can't be shared across ACObjects.

Andy
Andy is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 03:29 PM.


AC3D Forum
(C) Inivis Limited 2020