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

Hi there!!

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

At java mode, it works nice :open_mouth: :

Captura%20de%20pantalla%20de%202019-09-30%2016-24-43

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:

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 :blush::blush: !!

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 :upside_down_face:


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 :hugs::hugs: !!

Okay… the command is:

car.setTexture(color);

:man_facepalming::man_facepalming::man_facepalming:

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


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