We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.9.3
All
ortho()
This is due to ortho() using the _renderer to get its width and height:
_renderer
p5.js/src/webgl/p5.Camera.js
Lines 2242 to 2246 in f62fc6d
p5.FramebufferCamera has a this.fbo property, so probably in ortho every instance of _renderer should be replaced with (this.fbo || this._renderer).
p5.FramebufferCamera
this.fbo
ortho
(this.fbo || this._renderer)
let fbo let fboCam function setup() { createCanvas(400, 400, WEBGL); fbo = createFramebuffer({ width: 200, height: 400 }) push() fboCam = fbo.createCamera() pop() fboCam.ortho() } function draw() { background(220); fbo.draw(() => { setCamera(fboCam) rectMode(CENTER) rect(0, 0, fbo.width, fbo.height) }) imageMode(CENTER) image(fbo, 0, 0) }
Live: https://editor.p5js.org/davepagurek/sketches/s2u8gyUSb
Actual behaviour: the framebuffer has a white rectangle 1/4 of the width of the main canvas instead of 1/2:
Expected behaviour: the framebuffer has a white rectangle half the width of the main canvas
The text was updated successfully, but these errors were encountered:
createCamera
Successfully merging a pull request may close this issue.
Most appropriate sub-area of p5.js?
p5.js version
1.9.3
Web browser and version
All
Operating system
All
Steps to reproduce this
Steps:
ortho()
on the cameraThis is due to
ortho()
using the_renderer
to get its width and height:p5.js/src/webgl/p5.Camera.js
Lines 2242 to 2246 in f62fc6d
p5.FramebufferCamera
has athis.fbo
property, so probably inortho
every instance of_renderer
should be replaced with(this.fbo || this._renderer)
.Snippet:
Live: https://editor.p5js.org/davepagurek/sketches/s2u8gyUSb
Actual behaviour: the framebuffer has a white rectangle 1/4 of the width of the main canvas instead of 1/2:
Expected behaviour: the framebuffer has a white rectangle half the width of the main canvas
The text was updated successfully, but these errors were encountered: