Loading...
Logo
Processing Forum
Anyone have luck making peasycam working with orthographic projection.  My test of it doesn't allow me to zoom and seems pretty wonky...  Thanks...

Copy code
  1. import peasy.*;

  2. PeasyCam cam;

  3. void setup() {
  4.   size(200,200,P3D);
  5.   ortho(-width/2,width/2,-height/2,height/2,-200,200);

  6.   cam = new PeasyCam(this, 100);
  7.   cam.setMinimumDistance(50);
  8.   cam.setMaximumDistance(500);
  9. }
  10. void draw() {
  11.   rotateX(-.5);
  12.   rotateY(-.5);
  13.   background(0);
  14.   fill(255,0,0);
  15.   box(30);
  16.   pushMatrix();
  17.   translate(0,0,20);
  18.   fill(0,0,255);
  19.   box(5);
  20.   popMatrix();
  21. }

Replies(5)

Peasy doesn't seem to do ortho no matter what. I had to send an ortho view that overrides peasycam.
Isn't the whole point of ortho() to make objects always seem the same size? What would you expect zooming to do?

--
Jonathan Feinberg jdf@pobox.com http://MrFeinberg.com/
Zoom in an Otho view would let you make the object equally bigger across the screen, also pan, and rotate would be useful. 

Love the peasy library btw.
Pan and rotate work fine for me in ortho() mode with PeasyCam. In fact, the code in the original post works as expected. What problem are you seeing?

--
Jonathan Feinberg jdf@pobox.com http://MrFeinberg.com/
That zoom doesn't work, but it makes sense that it doesn't.  Ortho doesn't seem to reference camera position for size  -- it is based on the cutting planes...