Manipulating mesh vertices #3921
Unanswered
pintariching
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I wanted to manipulate the vertices of a mesh with WASD keys and press space to switch between the vertices. Here is a repo of the project if anybody wants to check it out.
The problem I have is the following:
I have the mesh and the vertices defined like so:
then when I create the
MaterialMesh2dBundle
entity I insert a componentThen later in the code I reference the mesh and positions and change the vertex position of a mesh and update them like so
Now I have a problem I can't seem to solve. I can move the top right vertex with the coordinates
[100., 100., 0.]
without a problem.However the other vertices are giving me problems. Both the top left
[100., 0., 0]
and bottom right vertex[0., 100., 0]
can only move in one direction and the bottom left vertex[0., 0., 0.,]
doesn't move at all.The code to move a vertex on each update looks like this:
I would like to move all 4 vertices of the square but for some reason they don't want to.
Beta Was this translation helpful? Give feedback.
All reactions