# How can you load a PNG texture to an OBJ?

**URL:** <https://discourse.processing.org/t/how-can-you-load-a-png-texture-to-an-obj/3964>\
**Category:** Coding Questions\
**Created:** [September 29, 2018, 11:44pm UTC](https://discourse.processing.org/t/how-can-you-load-a-png-texture-to-an-obj/3964 "2018-09-29T23:44:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mandelbrot](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@Mandelbrot](https://discourse.processing.org/u/Mandelbrot)\
**Post date:** [September 29, 2018, 11:44pm UTC](https://discourse.processing.org/t/how-can-you-load-a-png-texture-to-an-obj/3964/1 "2018-09-29T23:44:02Z")

</div>

My program is so far very simple. It loads an OBJ with `phaser = loadShape(“PhaserTypeII.obj”);`, then it displays it: `shape(phaser, 0, 0)` in setup and draw functions respectively. That worked, and the model shows up. I have a PNG texture that I would like to load onto the model. How can I do that? Thanks for your help!

---

<div class="post-metadata">

**Author:** ![desk](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@desk](https://discourse.processing.org/u/desk)\
**Post date:** [October 1, 2018, 6:17am UTC](https://discourse.processing.org/t/how-can-you-load-a-png-texture-to-an-obj/3964/2 "2018-10-01T06:17:49Z")

</div>

There is a setTexture() method which you can find in the P3D tutorial.

```auto
PImage img;
PShape globe;
	
void setup() {
  img = loadImage("earth.jpg");
  globe = createShape(SPHERE, 50);
  globe.setTexture(img);
}

```

See [the tutorial](https://processing.org/tutorials/p3d/) for more methods and information related to textures.
