About Store Forum Documentation Contact



Post Reply 
Mesh Create
Author Message
Gajet Offline
Member

Post: #1
Mesh Create
hi,
i was trying to create a mesh by inserteing it's vertices and triangles (quads) but every time i try to draw it i get an "acces violation" where i'm going wrong?

to create the mesh i'm using code below :

mesh.create(4,4,0,1);
mesh.addVtx(Vec(0,0,0));
mesh.addVtx(Vec(1,0,0));
mesh.addVtx(Vec(0,1,0));
mesh.addVtx(Vec(1,1,0));
mesh.addQuad(VecI4(1,2,3,4));

and then to draw it i tried to use :

mesh.draw2D(WHITE,BLACK,WHITE);
08-18-2010 08:24 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Mesh Create
create(4,4,... ) already allocates 4 vertexes and 4 edges, to manually edit them using
vtx.pos[0]=...
edge.ind[0]=...

just set create(0,0,..)
call addVtx (will dynamically add vertexes)

and addQuad(VecI4(0,1,2,3)) indexes are _zero_ based!
08-18-2010 12:13 PM
Find all posts by this user Quote this message in a reply
Post Reply