Pickedtriangle() will let you pick triangles so thats easy, just maintain a list of picked triangles for each surface (pickedsurface).
However to achieve your effect is going to be a bit more difficult. Maybe you could do somthing like this : Copy the original mesh to a new mesh (copymesh). Store all the triangle information for each surface. Pick from the old mesh. When the list of selected triangles changes: If unselecting triangles Clear the corresponding surface triangle information in the new mesh. Rebuild the surface triangle information with just the selected triangles. If adding to the selection just addtriangle. (This of course assumes that copymesh does not change the vertex order or surface order/composition, I have no idea, so you will have to reassure yourself on that point. If it does you have a bit of a problem. You can build a new mesh yourself, but the problem then becomes one of getting at surface properties :).
Now if you are drawing your own wireframe from the old mesh you can easily exclude the selected triangles. If you are using the cards built in wireframe then you might be able to achieve something similar by rendering again but not clearing the color or zbuffer using cameraclsmode camera false,false and scaling the new mesh up slightly to avoid zbuffer fighting. Thats if you don't want wireframe around the selected triangles, if you do then its easy in the first case, and in the second case try the reverse. Scale the old mesh up slightly and render this second with wireframe enabled as mentioned above. If you want to avoid scaling the mesh entities try scaling the camera slightly between renders.
|