I have a model of a car which I have exported to a glTF. How can I group elements in Blender like the wheels so they appear separately in the JSON code? I have created Vertex Groups but they don’t seem to appear in the code.
For things like the wheels of a car, you want them to be separate meshes, in separate nodes. A glTF "Node" corresponds to a Blender "Object" which owns the glTF "Mesh" or Blender "Mesh". Each node and each mesh get their own block of JSON in the glTF.
If your car is all one mesh, go into Edit Mode on that mesh, select all the faces/vertices of the wheels, press P, and choose
Selection. This will create a second object with the selected faces. Leave Edit Mode and rename the new object to a more descriptive name like "Wheels".
If your plan is to spin the wheels, you may wish to take some extra steps. The back wheels and the front wheels should be separate objects (or perhaps all four wheels could be separate, if they spin individually). The origin point for each wheel should be somewhere along the centerline of the axle for that wheel. The wheels should each declare the car body as a parent object, so that when the car itself moves, the wheels come with it.