Weird UV mapping on plane when vertices are moved


I’ve been working on a scene where I can manipulate the corners of a plane (for projection mapping purposes). The plane is UV mapped.

When I move the vertices the mapping gives unexpected results; it looks like it splits the plane in two triangles (which isn’t a weird thing) and maps the texture on those triangles instead of evenly between the 4 vertices.

See image for what I get and what I expected.

I’m pretty sure that OpenGL can do what I want so the question is… how? Do I need to set up my material/texture differently?

EDIT: Just to clarify: I’m moving the vertices over the x and z axis, so the plane does stay flat :slight_smile:

In theory, yes. In the game engine, no. Every mesh is triangulated if I’m correct. So the behaviour you are seeing is correct.

Your best bet is to subdivide the mesh, or remap the UV.

I’m not sure what engine does have this option actually. OpenGL does have quads but under the hood it’s still triangles.

Yeah I’ve come to the same conclusion: this is correct behaviour (maybe not the desired behaviour). So the next question is… can I subdivide in the game engine… at runtime?

Well from my understanding there is no mesh editing in the BGE. You can edit the UV though. That makes me wonder how you edited the mesh in the first place.