Hi, I’ wandering if it would be possible to cap mesh with javascript
What do you mean by ‘cap mesh’? (Apologies if this is known terminology - I tried Google, but didn’t see anything right off.)
It is in 3d max, you can Cap deleted polygons: http://designreform.net/2008/04/3ds-max-modifiers-cap-holes/
Sure, you could do it procedurally using scripting. You’d basically have to create the functionality from scratch, but it could certainly be done.
For more info, check out the scripting docs for the Mesh class. Basically, the Mesh class has ‘vertices’, ‘normals’, ‘colors’, ‘uv’, and ‘triangles’ fields through which you can acquire and set the mesh data. For this, you’d most likely need to build connectivity data based on the triangle indices, generate new triangles (and possibly vertices) as appropriate, and then re-assign the new data to the mesh.
aahh, yes it can be done so, but this would be very very hard, I think it needs high mathematics.
It would be good if mesh class have such function.
I would have to disagree with that.
If the mesh class should have a ‘cap’ function, then it should probably also have quite a few other functions as well, such as flipping of normals, application of subdivision surface algorithms, decimation, uv mapping, etc. (the logic being that these are all mesh operations that one might need at one point or other).
By the time you’ve added all of this functionality, you’ve basically duplicated the functionality of a dedicated modeling package (such as Blender, etc.) within Unity. And if you’ve got a dedicated modeling package in there, why not include image and audio editing support as well? You could apply filters to textures from your scripts, apply effects to audio files, etc., etc.
The point is, there are already applications which handle these things, and handle them well; as such, providing in-depth model, image, or audio editing functionality from within Unity would be redundant.
Unity is a general-purpose game engine and authoring tool, and closing up a gap in a mesh is (IMO) really too specific a task to be supported natively. But, that’s what the scripting interface is for; if you have particular functionality that you need, you can always write code for it.
If unity had this functions it would be very very helpful and I’ll be create procedurally destruction system. ![]()
What I was trying to say earlier is that (IMO) this isn’t a reasonable expectation. (I explained my point of view earlier, so I won’t elaborate here.)
However, if you feel that this is something that would be reasonable for Unity to support natively, you can certainly let them know
Find the Unity ‘feature requests’ section (don’t have a link handy at the moment) and request the feature. (If others agree that this is an important feature for Unity to have, they’ll vote it up.)