Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webcam Capture Loads Blank Pixel Array in P2D/P3D #160

Open
aidanlincolnn opened this issue Apr 30, 2020 · 2 comments
Open

Webcam Capture Loads Blank Pixel Array in P2D/P3D #160

aidanlincolnn opened this issue Apr 30, 2020 · 2 comments

Comments

@aidanlincolnn
Copy link

Description

When you create a canvas with P2D or P3D, the webcam capture does not contain any data (it is an array of black pixels).

Expected Behavior

The capture object pixel array should contain data

Current Behavior

The capture object pixel array contains all black

Steps to Reproduce

Run this program
import processing.video.*;
Capture video;
PImage theImage;

void setup() {
//this loads an array of black pixels
size(640, 480, P3D);
//this works as expected
//size(640, 480);
video = new Capture(this, 640, 480);
video.start();
}

void draw(){
if (video.available()) video.read();
theImage = video.get();
theImage.loadPixels();
image(theImage,0,0);
}

Your Environment

  • Processing version: 3.5.4
  • Operating System and OS version: OSX Catalina 10.15.4
@clankill3r
Copy link

Not sure if the webcam has anything to do with it, cause this results in an array with only zero's as well:

PGraphics pg;

public void settings() {
    size(512, 512, P3D);
}

public void setup() {
    pg = create_some_graphics();
    pg.loadPixels();
}


public void draw() {
    background(0);
    image(pg, 0, 0);
}



PGraphics create_some_graphics() {
    PGraphics pg = createGraphics(512, 512, P3D);
    pg.beginDraw();
    pg.background(0);
    pg.pointLight(255, 0, 0, 0, height/2, 500);
    pg.pointLight(0, 0, 255, width, height/2, 500);
    pg.pointLight(0, 255, 0, width/2, 0, 500);
    pg.translate(width/2, height/2);
    pg.rotateY(0.01f * random(123));
    pg.rotateX(0.05f * random(456));
    pg.rotateZ(0.07f * random(789));
    pg.fill(255);
    pg.sphere(150);
    pg.box(500, 20, 20);
    pg.box(20, 500, 20);
    pg.box(20, 20, 500);
    pg.endDraw();
    return pg;
}

@benfry benfry transferred this issue from processing/processing Aug 20, 2020
@lmagoncalo
Copy link

This issue still remains, and no solution can be found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants