greeting I want to translate this code java to android..friends please help me

edited May 2016 in Android Mode
import saito.objloader.*;
import codeanticode.gsvideo.*;

OBJModel model;
GSCapture cam;
//String camPara = "C:/Users/MSR.info/Documents/Processing/libraries/nyar4psg/data/camera_para.dat";





void setup(){
size(640, 480, P3D);
model = new OBJModel(this,"mankey.obj");
model.scale(90);
model.translateToCenter();
noStroke();
cam = new GSCapture(this, 640, 480); // initialize the webcam capture at a specific resolution (correct and/or possible settings depend on YOUR webcam)
cam.start(); // start capturing
}


void draw(){
  if (cam.available()) {
cam.read(); // read the cam image
background(cam); // a background call is needed for correct display of the marker results

 fill(180, 0, 0, 127);
  translate(mouseX, mouseY);
  rotateX(mouseX*0.04);
  rotateY(mouseY*0.04);
  
  
  lights();
 
  model.draw();
}}
Tagged:

Answers

  • @hafedh:::

    first of all you have to be sure that your libs are android compatible and it seems to me that they are not; as for capture: ketai lib; as for saito i dont know, perhaps min3D, depends of your models.

  • Hello @hafedh , if you want to rotate or move an image, this code that I've done, it can h help you.

    float counter;
    PImage FC;
    
    int SIZE = 22;
    int carga = 0;
    int ancho = 800;
    int alto = 480;
    void setup()
    {
      counter=0.0;
      size(800,480);
      FC=loadImage("http://img110.xooimage.com/files/4/5/b/mini-robot-4a0c8b8.png");  
    //  FC.resize(int(ancho*0.2),int(ancho*0.2)); FC.loadPixels();
      background(122,155,129);
    }
    
    void draw()
    {
      if(carga != 100){carga++;imagen_carga(carga);delay(50);}
     }
    
    void imagen_carga(int dat)
    {
      imageMode(CENTER);
     if(dat > 100){dat = 100;}
       background(122,155,129);//  image(fondo, ancho/2, alto/2); 
      translate(ancho/2, alto/2);
      rotate(dat*18*TWO_PI/360);
      image(FC,0,0); fill(22); 
        rotate(-dat*18*TWO_PI/360);//image(img,0,0);
        textAlign(CENTER,CENTER); textSize(SIZE);text(Integer.toString(dat)+"% ", 0,0 );
          translate(-ancho/2, -alto/2);
    }
    
  • @akenaton==== on this exemple what is the change on this code when i replace the saito lib with ketai lib!!! and thank's advance

Sign In or Register to comment.