- Home /
Manipulate Mesh Vertices
Hello guys, I'm trying to make a simple movement with my mesh vertices, but i don't think i'm doing this the right way.
Basically, what I want to do is this:
I have the mesh, like the first image, and i want to move the middle vertices on the yellow axis ( in blender its the Y, unity should be Z ) just like i did on the other 2 images. but i want to set them to specific locations real time in unity. What's the best way to do this? I tought about doing something with animation, but I didnt find any way to animate vertices ( is there a way to do this? ).
Then i tought about manipulating the vertices itself, and I tried a few things, but I didn't understend how that works yet... For exemple, i tried getting an Vector3 array for the vertices of the mesh, and it gave me 48 vertices instead of 16 ( if you count the vertices on the mesh of the picture, its 16.) I heard something about unity duplicating the vertices for each face, or something like that, but I still dont understand that much. Also, 48 = 16 * 3, is there any relation in this?
Well, I know my question isnt very clear, but what I want to do, is to manipulate those vertices real time. Whats the best way to do this? Getting the array of the vertices and changing them via script? Is there any way to apply animation to vertices? Thanks!
EDIT
I also tought of having 3 separate objects, the left most plane, the right most plane, and the middle section I want to manipulate, just like this picture:
Then, create the faces manually to link the objects, and then i could simply apply transform.position in the middle object. Is there a way to do this?
Your answer
Follow this Question
Related Questions
Record Animation Clip from changes made with Mesh API? 1 Answer
Earth mesh rendering 1 Answer
Holes in procedural mesh 0 Answers
Make mesh collider constantly change 1 Answer