View Full Version : Adding a vertex to a surface??
26th September 2004, 04:19 PM
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?
27th September 2004, 05:41 AM
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:
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:
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.
Prototype void object_add_vertex(ACObject *ob, Vertex *p);
28th September 2004, 07:43 PM
ahhh add it to the object as well.
who would have thUnk of that.
ill try it as soon as my computer finishs defraging.
vBulletin® v3.8.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.