STL 3D Model exported into OBJ file

Today I exported a .STL 3D model in blender to an .OBJ file. When I loaded the model into Processing.js it was black. I added lighting but it didn’t illuminate the model. Is there an alternative file to export that is better? What am I doing wrong?

1 Like

Pretty sure you need to export a material aswell, havent played much with 3d models and processing but i do remember the same issue when i did

1 Like

How do I export a material as well?

The option should be in blender, think its on by default so you should see it in the folder you exported the .obj file to, if not check the blender export window, on the right side scroll down until you see material options, if that is already on and you dont see a material in the folder you probably have to add a material in blender before exporting

1 Like

This forum thread may or may not be helpful: . Also there is an example in File/Examples/Basics/Shape/LoadDisplayOBJ. Look in the data folder of this project and you will see the other files that are required:


Path to examples on my system:

1 Like

Did you manage to get it working?

I’m going to give your suggestion a try today! I’ll let you know if it works, @Mikey83 ! Thank you! Happy Holidays!

I was able to add a material when exporting as well as the .mtl file to my sketch, but the model is still black…

PShape mobius;
PImage txtr;
float theta;

void setup(){
  txtr = loadImage("grid3.jpg");
  mobius = loadShape("ring.obj");

void draw() {
  translate(width/2, height/2);

What am I doing wrong?

Where’s the texture? It has to have a .png or some graphic to stick on your object and the .mtl file has to call for it.

Is that obj file that you downloaded free? If you don’t have an objection would you post the url so that others can try? It would also be nice to see the code in the .mtl file; it’s just a txt file if you haven’t looked inside yet.

1 Like

Yes, the 3d model is from Thingiverse! How do I upload the 3d model to this discussion?

The grid .jpg files are the texture. Can I not use the .jpg’s for texture?

I am open to sharing a link, but the only thing is that I may not be able to find it again! Let me try to find it…

The model has been deleted by the creator, but I can email you my files?

Can I not use the .jpg’s for texture

Likely can but the .mtl file has to have it listed as a source. The original object should have had an accompanying graphic file ideally.

I just downloaded a turtle object from Thingiverse and there is a .png file but no .mtl file. Where did you get the .mtl file for your project?

We need to see both the .obj file and the .mtl files. They may both be opened with TextEdit on a Mac. Copy/paste the code here so we can see the contents of each. Usually the .obj file lists the name of the .mtl file on the first line, eg mtllib something.mtl and the .mtl file lists the graphic file to be used. It works best if all three files, ie .mtl, .obj, and .png files are downloaded together. I did find that it is possible in some cases to add a custom .png if one is not included (some .pngs couldn’t be added). Sometimes it was possible to modify the File/Examples/Basics/Shape/LoadDisplayOBJ .mtl file and use it if one was not included with the .obj download, but it didn’t always work.

Hello @asymmetric,

I was able to import an STL with Blender and export it to an OBJ with UVs and texture it in Processing as follows:


  • OS and Software:
    Windows 10 Pro
    Processing 4.1.1
    Blender 3.3.2 LTS

  • Mobius.stl from:
    Mobius Surface by qvist - Thingiverse

  • Open Blender and import Mobius.stl

  • Change from Object Mode to Edit Mode

  • Select UV > Cube Projection (you can try other selections later)

  • Export Wavefront (.obj) to any name of your choosing.

  • image

  • Add files to your Processing sketch

  • Processing code:

// Texture
mobius = loadShape("untitled_cube.obj"); 
txt = loadImage("frog.png"); // Add your own image here
// Fill with color
mobius = loadShape("untitled_cube.obj");
mobius.setFill(color(255, 255, 0));

And voila!

There is a bit of a learning curve to all of this.
Enjoy the journey!


If this is a Processing.js issue I can’t help with that.

See comments here about Processing.js:



Is Blender freeware?