Triangles instead of faces ?

When I need to export triangles, I just triangulate as I export.

Something like:

for each face
andnbsp; andnbsp;for facepoint = 1 to numpointsinface-2
andnbsp; andnbsp; andnbsp; andnbsp;output face andquot;headerandquot;
andnbsp; andnbsp; andnbsp; andnbsp;output point andquot;0andquot;
andnbsp; andnbsp; andnbsp; andnbsp;output point andquot;facepointandquot;
andnbsp; andnbsp; andnbsp; andnbsp;output point andquot;facepoint+1andquot;
andnbsp; andnbsp;next point
next face

Richard

I’m in the middle of the creation of the .b3d exporter I mentioned in the general topic a few weeks ago.

I notice in the .x exporter I’m working from that the faces can have a number of points (eg, 4 in the case of a square, more for a circle) which is fine for .x, butI need to write the information for the triangles that make up the face.

I’ve tinkered with triangulating the object, prior to export, which looks like it will work. Is this the only way, or is there something hidden in there to allow direct access to the triangles ?

Alternatively, is there a way to triangulate from the script, perform the export then return the object back as it was ?

Yes, the first point andquot;0andquot; is always the common point.

And… You’re welcome!

Richard

ah,
Let me see if I’ve got this right,
so is the first point .. andquot;0andquot; always the common point for these faces ?

(btw, many thanks for the quick response.. as usual andnbsp;:) )

You must be logged in to reply in this thread.

4 posts