# Loading 3D models in android mode and adding textures (how to)

**URL:** <https://discourse.processing.org/t/loading-3d-models-in-android-mode-and-adding-textures-how-to/14339>\
**Category:** Processing for Android\
**Created:** [October 1, 2019, 7:22am UTC](https://discourse.processing.org/t/loading-3d-models-in-android-mode-and-adding-textures-how-to/14339 "2019-10-01T07:22:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Waboqueox](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/waboqueox/32/5643_2.png) [@Waboqueox](https://discourse.processing.org/u/Waboqueox)\
**Post date:** [October 1, 2019, 7:22am UTC](https://discourse.processing.org/t/loading-3d-models-in-android-mode-and-adding-textures-how-to/14339/1 "2019-10-01T07:22:48Z")

</div>

Hi there!!

I’m having problems loading 3d models in android.

At java mode, it works nice 😮 :

![Captura%20de%20pantalla%20de%202019-09-30%2016-24-43](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/6349f7fc7f8f2389bea30c394093ddb4e1a97429.png)

But using android mode I can’t even load it, and importing it to android studio and adding some code on the manifest I can load it, but without textures:

 ![Screenshot_20190930-162835](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/a5dad284a455282e1cc217cb705061994947fc69.png)

And trying to load a texture, making a PImage and texture(img), is neither working… I don’t know how to do it well… any help is welcome 😊😊 !!

I remember time ago to try the texture and it worked (with a random image and position), but is not working in my model now, or don’t remember the syntax 🙃

```auto

public class Modelos3D2 extends PApplet {

PShape car;
PImage color;

public void setup() {  
  car = loadShape("textured.obj");
  color = loadImage("image.jpg");
}

public void draw() {
  background(255);
  lights();
  translate(width/2,height/2);
  rotate(radians(180));
  rotateX(radians(60));
  rotateY(radians(180));

  scale((float) 0.75);
  texture(color); // tried both, to see if one of it
  car.texture(color); // works, but not 
  shape(car);
}

 public void settings() { size(displayWidth, displayHeight, P3D); }
}

```

Thanks 🤗🤗 !!

---

<div class="post-metadata">

**Author:** ![Waboqueox](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/waboqueox/32/5643_2.png) [@Waboqueox](https://discourse.processing.org/u/Waboqueox)\
**Post date:** [October 1, 2019, 7:37am UTC](https://discourse.processing.org/t/loading-3d-models-in-android-mode-and-adding-textures-how-to/14339/2 "2019-10-01T07:37:44Z")

</div>

Okay… the command is:

```auto
car.setTexture(color);

```

🤦‍♂️🤦‍♂️🤦‍♂️

Well, as information, say that the 2 lanes I put in the manifest are:

```auto

        android:largeHeap="true"
        android:hardwareAccelerated="false"

```

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [October 1, 2019, 12:11pm UTC](https://discourse.processing.org/t/loading-3d-models-in-android-mode-and-adding-textures-how-to/14339/3 "2019-10-01T12:11:10Z")

</div>



---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [October 1, 2019, 4:46pm UTC](https://discourse.processing.org/t/loading-3d-models-in-android-mode-and-adding-textures-how-to/14339/4 "2019-10-01T16:46:48Z")

</div>


