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

PeasyCam Broken with p5.js v0.7.2 September 02, 2018

Open CharlesFr opened this issue 5 years ago • 10 comments

Peasy cam doesn't load with the simple example provided in the readme - any ideas?

Uncaught TypeError: renderer.camera is not a function
    at EasyCam.apply (p5.easycam.js:608)
    at EasyCam.update (p5.easycam.js:591)
    at p5.easycam.js:429
    at callMethod (p5.js:55140)
    at Array.forEach (<anonymous>)
    at p5.redraw (p5.js:55148)
    at p5.<anonymous> (p5.js:48840)
    at p5.<anonymous> (p5.js:48742)
    at new p5 (p5.js:49029)
    at _globalInit (p5.js:48414)

CharlesFr avatar Oct 17 '18 11:10 CharlesFr

Also, could you indicated how to initialise the view with the Z going up towards the top of the browser?

CharlesFr avatar Oct 17 '18 14:10 CharlesFr

Getting the same issue from some users on OpenProcessing. Not sure hot to fix, but must a variable naming issue.

msawired avatar Oct 29 '18 21:10 msawired

While we await the above PR approval, OpenProcessing users who want to use 0.7.2 with EasyCam can drop the following fix into setup() prior to invoking createEasyCam()

    // fix for EasyCam to work with p5 v0.7.2
    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]))
    };

For example: http://www.openprocessing.org/sketch/621401

jwdunn1 avatar Nov 05 '18 02:11 jwdunn1

hi, i'm still having problem working with newer versions... please help..............

nevahid avatar Feb 03 '19 12:02 nevahid

The fix I have posted above also works with p5 v0.7.3 Here is another example: https://www.openprocessing.org/sketch/645473

jwdunn1 avatar Feb 03 '19 19:02 jwdunn1

hi again... thanks for your response... your code works just fine... i'm trying to continue working on it... thanks again

nevahid avatar Feb 04 '19 04:02 nevahid

why do i get this warning? p5.min.js:3 You must first call texture() before using vertex() with image based u and v coordinates many of it, repeatedly... consuming a lot

nevahid avatar Feb 04 '19 04:02 nevahid

Off topic: @nevahid A change was made on Jan 26: if calling vertex with 4 or more parameters, then a call must be made to texture() first. github.com/processing/p5.js/pull/3483

jwdunn1 avatar Feb 04 '19 06:02 jwdunn1

thanks a lot! after some modifications suggested by you, i got it working... and it seems mySketch.js should be loaded in body tag... don't know why, but it is working now... thanks again

nevahid avatar Feb 04 '19 08:02 nevahid

The fix I posted above also works with p5 v0.9.0 Example: https://editor.p5js.org/jwdunn1/sketches/1J8asex6f

jwdunn1 avatar Aug 28 '19 23:08 jwdunn1