Rotate a QuadMesh natively for GridMap use

Godot Version

4.2.1

Question

I am populating a GridMap with some meshes. Some of these are QuadMesh and I need them to be x-rotated by -45°.
The problem is that QuadMesh is allowing me to change the size, the offset, and the orientation (only on the xyz faces), there is no option to rotate it by a specific degree value.
I would like to change the orientation directly in the Mesh resource to maintain the transformation in the MeshLibrary used by the GridMap.
Is there a way to do this?

Also, I am using this GridMap to generate some procedural maps, is GridMap a good solution to do this or should I change my approach?

Thanks!

Anytime I’ve seen Gridmap come up for procedural generation it was not recommended.

The way I do it for slopes is creating a ConvexPolygonShape3D and setting the vertices of the two triangles (6 points) and then rotating them using this:

But this is probably different then what you are doing with the gridmap. Also, according to the quadmesh docs: Class representing a square mesh facing the camera. if you want it to rotate over x, it wouldn’t be facing the camera, right? Maybe you can try a PlaneMesh?

1 Like

Thank you for the response :slight_smile:
The solution I came up was to simply create the rotated mesh in blender, import it in the project as .obj and extract the mesh from there.

Both the QuadMesh and PlaneMesh can be only flattened on one of the three planes, but I have a camera that is rotated by 45° so to face it I had to rotate the meshes (billboard mode was not enought for my needs).

I’ll keep your solution into consideration, if GridMap is not good for procedural generation maybe it is better to rethink about everything from the start.