Using Thingiverse files in A-Frame

Thingiverse is a great repository of 3d models, many with a nice and permissive creative commons license. These models are designed to be 3d printed, but many of them also work great as models that you can use in SceneVR and A-Frame.

I’ve been thinking of adding automatic .stl import to the SceneVR editor, but in the meantime, you can use Blender to import the .stl and convert it to an .obj file.

Some wonderful knot shapes

So, go ahead and find a relatively simple 3d model. As per usual with webvr, you don’t want something with 100,000 faces, I usually aim for for around 5,000 faces per model, in this case, I’m using these cogwheels. Make sure your model has a licence that is compatible with what you want to do with it, creative commons licensed models are usually pretty good.

Nice simple cog wheels

Okay, so now, assuming you’ve installed Blender, launch blender, then right click on the square in the middle of the the scene, and press “x” to delete it.

An empty blender scene

Now, hit SPACE and type ‘import stl’.

Use the autocomplete menu to import the STL

STL support should be built into your Blender, and just work out of the box.

Now, when these gears are imported, you’ll find they are really large, much larger than the viewport. Each of those squares on the grid is a meter squared, so the cog when imported it about 20 metres across, much too big to use in a SceneVR scene. So what you want to do is to scale the cogs down to 10% the size. Do this by pressing “s” and typing “0.1”. Press enter and now the cogs are a decent size.

Now navigate to the .stl file you downloaded and import it. Now you’re ready to export the .obj, by simply hitting SPACE again and typing “export obj”. The one thing to be aware of here, is that you want to export your .obj with normals. So on the left hand side menu, make sure that ‘Write Normals’ is selected.

Make sure “Write Normals” is selected

Now give your .obj file a filename and import it into SceneVR, and you’re away, with some Gears to make into a scene.

Inverting normals

I had one weird thing with this cog model. When I imported it into SceneVR, it displayed inside out. You could see the back side of all the faces, but when you looked straight at the gear it was invisible. This is caused because the model had all it’s faced inverted, the inside was facing the outside and vice versa. You can fix this in blender.

First, with the gear selected, press tab to go into face selection mode. All the faces should be selected. If they are not, hit “a” to select all the faces.

All the faces are selected

Now press SPACE and type “flip normals”. You probably won’t notice much difference, but if you export the obj again, suddenly the gear looks correct.

Flip those normals!