View Single Post
Old 27th September 2004, 05:41 AM   #2
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,564
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