- Home /
Spread two vertices
hi,
someone knows how to spread out vertices one from each other like imagine you have two vertices, you mentally draw a line between those two points and you spread them out from each other on this line.
any idea ?
simply put, i'd like to enlarge a strip mesh made of triangles.
Answer by Armand · Jul 09, 2014 at 08:36 AM
You simply multiply each vertex with the correct scaling matrix, as detailed in http://en.wikipedia.org/wiki/Scaling_(geometry)#Matrix_representation.
This is sometimes preferable to changing the scale of the object's Transform in Unity, because scales other than 1.0 have some overhead and the Unity documentation recommends not doing that if possible.
Answer by Mike99 · Jul 09, 2014 at 08:48 AM
i'm trying to enlarge only some vertices of the mesh over time.
what i'm trying to achieve is to have a nonstop strip of quads being constructed (each quad made of two triangles).
at creation, the new quad of the strip is very narrow and it enlarges over time.
In that case, you would just use the scaling I linked up in my answer to scale on one axis - for example, to make objects wider but not taller, set the X component in the scaling matrix anything above 1 but leave the Y component at 1.
Your answer
Follow this Question
Related Questions
Mesh.vertices are all 0? 1 Answer
Checking If A Triangle Is In A Mesh 1 Answer
UnityEngine.UI.Text characters mesh 0 Answers
Editing vertices 1 Answer