Hello,
I was just pondering another thread
http://forum.processing.org/topic/is-pgraphics-the-only-way-to-solve-the-memory-problems-in-processing
when it occured to me whether PGraphics works in 3D? And if PGraphics and PeasyCam work together?
I think it does not (for both).
But I can call createGraphics with P3D as a renderer and I can call
- pg.line(40, 40, 100,
- 40, 40, 40);
But the result with peasyCam shows a 2D image which rotates.
My hope was to have a 3D tree e.g. that in stored as a PGraphics.
Is that possible?
Thank you!
Greetings, Chrisir
- //
- // test on PGraphics
- import peasy.org.apache.commons.math.*;
- import peasy.*;
- import peasy.org.apache.commons.math.geometry.*;
- //
- PGraphics pg;
- PeasyCam pCamera;
- //
- void setup() {
- size(800, 800, P3D);
- pg = createGraphics(480, 480, P3D);
- //
- pg.beginDraw();
- pg.background(102);
- pg.stroke(255);
- pg.line(40, 40, 100,
- 40, 40, 40);
- pg.line(140, 40, 100,
- 140, 140, -90);
- pg.endDraw();
- pCamera = new PeasyCam(this, 300);
- }
- //
- void draw() {
- background(50);
- image(pg, 10, 10);
- }
1