PDA

View Full Version : Exporting patches


fili
03-29-2005, 07:35 AM
I'm trying to make a little script to export an editable patch object (containing several quad patches) to a text file. The problem is that I don't know how to find out what vertices and control points make each patch (I didn't find something like patch.getPatchVertices).

I've written some algorithm (stupid O(n^2)) that can find wich vertices (and control points) make each patch, but there's a problem. Some of the patches have the normals fliped. This happens because I start with the vertex with the lowest index and search the next vertex, etc. Sometimes this gives me the vertices in the reversed order thus resulting a patch with fliped normals.

Do you have any ide of what should I do? Is there something like patch.getPatchVertices? (It isn't in the MaxScript help, but it wouldn't be the first time when a function exists but it's not in the help). Is there something I could do to detect the orientation of the patch? (I thought of creating a new patch with the extracted params, and compare the patch.getPatchNormal of the original and copied patch, but I don't like this method very much, because I have to modify my script a lot).

Thx.

CGTalk Moderation
03-29-2005, 07:35 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.