OCD camera.feed() to PGraphics
in
Contributed Library Questions
•
3 years ago
Hey all, relatively new guy here. I've been playing around with 3D environments in Processing using OCD to control the camera. What I want to do is overlay an image on top of the 3D view to frame it, and I figured the easiest way to do this would be to create a PGraphic of the 3D view and display the image on top of it. However, when trying to use the OCD cameras within beginDraw(), it tells me the camera "cannot be resolved or is not a field". Here's the code:
- import damkjer.ocd.*;
- PGraphics viewport;
- public Camera cam;
- void setup(){
- size(400,400);
- viewport = createGraphics(400,400,P3D);
- cam = new Camera(this, 0,0,50,0,0,0);
- }
- void draw(){
- viewport.beginDraw();
- viewport.background(255);
- viewport.box(50);
- viewport.cam.feed();
- viewport.endDraw();
- image(viewport, 0,0);
- }
Am I making some basic mistake, or does the library not support use within PGraphics, or is it something else entirely? Thanks!
1