Converting an OBJ. model to a GLB. model, using Blender

Here you will learn how to quickly convert an .obj model to a .glb model using Blender - including setting scale and rotation.

Step 1: Install Blender 

If you haven't installed Blender, download and install it from the official website: (https://www.blender.org/download/). 

Step 2: Open Blender 

Launch Blender and you'll see the default scene. 

Step 3: Import OBJ File 

  1. Delete Default Objects:
    1. Select the default cube, light, and camera objects and press `Delete` on your keyboard to remove them. 
  2. Import OBJ File:
    1. Go to `File > Import > Wavefront (.obj)`.
    2. Navigate to your OBJ file and select it. 

Step 4: Set Scaling 

Check Object Size:

  • After importing, your object might be too large or too small. 
  • Hold the mouse at the main 3D view (mouse location affects which menu is opened)  
  • Press `N` to open the right-hand toolbar and go to the "Item" tab. 
Adjust Scale:
  • Look for the "Scale" section. 
  • Set the scale values to make the object the desired size. A common scale might be `0.01` for reducing size. 

Step 5: Set Rotation 

Check Object Rotation:

  • Ensure your object is oriented correctly. If it's not facing the right direction, you'll need to adjust the rotation.
Rotate Object:
  • Press `N` to open the right-hand toolbar and go to the "Item" tab. 
  • Type in a value at the "Rotation" section to rotate the object until it faces the desired direction. 

Step 6: Apply Scale & Rotation 

  • Select all of the objects. 
  • Navigate to the Object menu -> Apply -> Rotation & Scale to apply the values you have currently set to the object.  

Step 7: Export as GLB 

Delete Unnecessary Elements:

  • Remove any unnecessary elements or objects in your scene. 

Export as GLB:

  • Go to `File > Export > glTF 2.0 (.glb)`. 
  • Choose a destination and name for your GLB file. 
  • In the export settings, ensure "Selected Objects" is checked if you only want to export the currently selected object. 
  • Click on "Export glTF 2.0" to save your GLB file. 

Step 8: Check Your GLB File 

To ensure that everything worked correctly, you can use a 3D viewer or an online GLB viewer to open and inspect your GLB file like https://sandbox.babylonjs.com/ (files are stored locally on your PC, the browser link is just a viewer nothing is uploaded to the website).  

That's it! You've successfully converted an OBJ file to a GLB model in Blender, including setting the scaling and rotation.