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 26th September 2004, 04:19 PM   #1
LiveWire
Senior Member
Professional user
 
Join Date: Nov 2003
Location: Eugene OR, USA
Posts: 212
Default Adding a vertex to a surface??

k, im making a plugin, that works with adding vertexs to surfaces...
but i cant figure out how exactly to do this.

do i recreate the whole Surfaces List( List *Currect_Surf_List )?
or do i recreate each surfaces Vertex List?
or is there some ac_command that just adds one...
or somthing else?

thanx
--phil
LiveWire is offline   Reply With Quote
Old 27th September 2004, 05:41 AM   #2
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default

You'll need to:

create vertices and add each one to the surface AND the object

There are various functions to create/set a vertex:

Code:
Prototype Vertex *new_vertex(void);
Prototype Vertex *new_vertex_set(float x, float y, float z);
Prototype Vertex *vertex_clone(Vertex *p);
Prototype void vertex_set_point(Vertex *v, Point3 *p);
You should never(rarely?) need to modify the lists directly, always use a function to add and remove items from surfaces and objects.

To add the vertex to a surface:
Code:
Prototype SVertex *surface_add_vertex(Surface *s, Vertex *p, float tx, float ty);
(a surface maintains a list of SVertex's which contains the vertex pointer and the texture coordinates)

The vertex must also be added to the object which holds the surface.

Code:
Prototype void object_add_vertex(ACObject *ob, Vertex *p);

Andy
Andy is offline   Reply With Quote
Old 28th September 2004, 07:43 PM   #3
LiveWire
Senior Member
Professional user
 
Join Date: Nov 2003
Location: Eugene OR, USA
Posts: 212
Default

ahhh add it to the object as well.
who would have thUnk of that.
thanx.

ill try it as soon as my computer finishs defraging.
LiveWire 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 12:30 AM.


AC3D Forum
(C) Inivis Limited 2020