Quantcast
Channel: Android Mode - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 941

Run Processing Camera sketch on Android

$
0
0

Hi, again. I've got this working Processing sketch just to test the camera:

/** ||******************************
 ** ||
 ** ||
 ** ||
 ** ||*****************************/

import processing.video.*;

Capture video;
int x, y;

void setup()
{
  size(640, 480);
  //
  x = width;
  y = height;
  //
  video = new Capture(this, Capture.list()[5]);
  video.start();
  //
  background(0);
}
/******************************************************/
void captureEvent(Capture video)
{
  video.read();
}
/******************************************************/
void draw()
{
  //
  video.loadPixels();
  image(video, 0, 0, x, y);
}

What am trying to do is, to load that sketch to an Android Studio app. Loading an sketch comes easy for me, they work. But with this one since to not be the case. I also tried this example: https://github.com/omerjerk/processing-video-android

And the experiment results in failure.

So, what would be the correct way of loading a Processing sketch using capture in Android.


Viewing all articles
Browse latest Browse all 941

Trending Articles