Vertex World Rotation?

increasing a vertex.x on a mesh is the same as changing it’s transform.position.x if the object is not rotated, …IF the object is rotated, it’s the same as changing its transform.localPosition.x, I am obliged to change its localposition when the object is rotated, but I want to change its world position.

Say I have 20 rotated objects and I want to change the vertices all according to world position, there is no easy way to do that in unity, because I’m obliged to increase the vertex coordinates in their local rotation, and therefore local position.

Is there a way to solve the above issue? so that increasing vertex.x sends a vertex towards the right no matter the rotation of the mesh?

I’m not entirely sure I understand exactly what you want to do here, but these should point you in the right direction. Let me know if you need more help.
You can use transform.TransformPoint() to transform a point from local space to world space. You can also use transform.InverseTransformPoint() to convert from world space to local space.

So your solution might look something like this:

Vector3 newVertex = new Vector3(transform.TransformPoint(vertex));
newVertex.x+=5;
newVertex = transform.InverseTransformPoint(newVertex);

Good luck!

You can use transform.TransformDirection, transform.TransformPoint and the inverse functions of these to accomplish this.
(This is basically just a summary of the comments above, posted here so the question will show up as answered.)

You can use transform.TransformDirection, transform.TransformPoint and the inverse functions of these to accomplish this.
(This is basically just a summary of the comments above, posted here so the question will show up as answered.)

I am not totally convinced about this page…

The transform. transformDirection will tell you the vector orientation of the object, which is super difficult afterwards to use…

So transform transformpoint, fine gets you the world position and scale of vertices…

and afterwards transfor direction, you would have to use it to pivot every vertex around some point in space to find the position of every vertex including their world position and world rotation…

so you would have to use some kind of crazy rotate around to match the difference in between upwards and rotated object.

I am pretty sure of that from experience.

How to do it is sooo much coding and rotations. OMG. i don’t know off hand how to do it and it cant be a trivial afternoon task for an average programmer.