p5.EasyCam icon indicating copy to clipboard operation
p5.EasyCam copied to clipboard

EasyCam not working for p5.js 0.9.0!

Open lockness-Ko opened this issue 4 years ago • 2 comments

I have tried to use EasyCam but the canvas doesn't show when I use easycam

Here is my code:

var easycam;

function setup() {
  createCanvas(400, 400, WEBGL);
  easycam = createEasyCam();
}
function draw() {
  background(0);
  lights();
  box(100);
}

Here is screenshot:

image

lockness-Ko avatar Aug 28 '19 22:08 lockness-Ko

Two things to make EasyCam work with 0.9.0:

  1. Be sure to include in the index file:
  2. Insert the following before the call to createEasyCam(): // fix for EasyCam to work with p5 v0.9.0 Dw.EasyCam.prototype.apply = function(n) { var o = this.cam; n = n || o.renderer, n && (this.camEYE = this.getPosition(this.camEYE), this.camLAT = this.getCenter(this.camLAT), this.camRUP = this.getUpVector(this.camRUP), n._curCamera.camera(this.camEYE[0], this.camEYE[1], this.camEYE[2], this.camLAT[0], this.camLAT[1], this.camLAT[2], this.camRUP[0], this.camRUP[1], this.camRUP[2])) }; Example: https://editor.p5js.org/jwdunn1/sketches/1J8asex6f See also issue 5.

jwdunn1 avatar Aug 28 '19 23:08 jwdunn1

@jwdunn1 Thank you for the answer. It works in an online editor with the example you gave and also locally on my laptop, however, when uploaded the sketch to my website, the EasyCam does not work. Do you know what it could be? Regards_

gaborpaszti avatar Jul 03 '20 10:07 gaborpaszti