x


Decombine script or recalculate part of mesh?

hi there. im looking for solution for pretty complicated problem, this tool may rly help me. so, the question is:

is there some kind of "decombine" script? (for example get a part of mesh and assign it to another mesh filter)

i need it cos i want to add some triangles to pretty huge model via runtime, and may be "decombine" will be nice solution. (get part of mesh, change ammount of triangles, combine it back)

tyvm for all responds :)

more ▼

asked Mar 19 '11 at 05:09 PM

DEtH_MoroZ gravatar image

DEtH_MoroZ
13 7 9 15

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Creating a new mesh from part of another mesh provides some interesting difficulties:

  1. Creating a new mesh is as easy as var mesh = new Mesh();.

  2. Another task is getting the vertex arrays from the first mesh. If you are simply doing a distance check, then it isn't very hard. If you want complex shapes, then you will have to to find an algorithm that isolates only the vertices you want- maybe use vertex color.

  3. Recreating the triangle arrays is probably going to be the hardest part. If you are lucky and removing a submesh, that will save you some time. Otherwise. Same as above. You will need to procedurally recreate the triangle indices.

Decombining a mesh won't come easily. Your best option would be to store the vertex and triangle indices before you combine the mesh so that you can take it apart more easily.

more ▼

answered Mar 19 '11 at 05:23 PM

Peter G gravatar image

Peter G
15.1k 16 44 137

tyvm :) im getting triangles i want to use by spherecastall, but problem is that im creating new triangles and assign them back, its takes alot of time.

Mar 19 '11 at 05:34 PM DEtH_MoroZ
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1403
x99
x35
x16
x12

asked: Mar 19 '11 at 05:09 PM

Seen: 866 times

Last Updated: Mar 19 '11 at 05:09 PM