{"action":"created","issue":{"url":"https://api.github.com/repos/processing/p5.js/issues/1843","repository_url":"https://api.github.com/repos/processing/p5.js","labels_url":"https://api.github.com/repos/processing/p5.js/issues/1843/labels{/name}","comments_url":"https://api.github.com/repos/processing/p5.js/issues/1843/comments","events_url":"https://api.github.com/repos/processing/p5.js/issues/1843/events","html_url":"https://github.com/processing/p5.js/issues/1843","id":212004672,"number":1843,"title":"No shapes with WebGL and createGraphics","user":{"login":"scottlittle","id":2524998,"avatar_url":"https://avatars3.githubusercontent.com/u/2524998?v=3","gravatar_id":"","url":"https://api.github.com/users/scottlittle","html_url":"https://github.com/scottlittle","followers_url":"https://api.github.com/users/scottlittle/followers","following_url":"https://api.github.com/users/scottlittle/following{/other_user}","gists_url":"https://api.github.com/users/scottlittle/gists{/gist_id}","starred_url":"https://api.github.com/users/scottlittle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottlittle/subscriptions","organizations_url":"https://api.github.com/users/scottlittle/orgs","repos_url":"https://api.github.com/users/scottlittle/repos","events_url":"https://api.github.com/users/scottlittle/events{/privacy}","received_events_url":"https://api.github.com/users/scottlittle/received_events","type":"User","site_admin":false},"labels":[{"id":218243056,"url":"https://api.github.com/repos/processing/p5.js/labels/area:webgl","name":"area:webgl","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-03-06T01:44:01Z","updated_at":"2017-05-18T10:42:15Z","closed_at":null,"body":"This code does not produce any spheres.  Does anyone know why?\r\n```\r\nvar pg;\r\n\r\nfunction setup() {\r\n  createCanvas(100, 100, WEBGL);\r\n  pg = createGraphics(100, 100, WEBGL);\r\n  pg.show();\r\n}\r\n\r\nfunction draw() {\r\n  background(128);\r\n  sphere(100);\r\n\r\n  pg.background(128);\r\n  pg.sphere(100);\r\n}\r\n```\r\nHere's the output images:\r\n![image](https://cloud.githubusercontent.com/assets/2524998/23593817/67ce0bbe-01d9-11e7-81f5-07fb9e76655e.png)\r\n![image](https://cloud.githubusercontent.com/assets/2524998/23593811/4b480080-01d9-11e7-836d-2058e442ee91.png)\r\n\r\n[Related issue](https://github.com/processing/p5.js/issues/1475)"},"comment":{"url":"https://api.github.com/repos/processing/p5.js/issues/comments/302368362","html_url":"https://github.com/processing/p5.js/issues/1843#issuecomment-302368362","issue_url":"https://api.github.com/repos/processing/p5.js/issues/1843","id":302368362,"user":{"login":"sixhat","id":614881,"avatar_url":"https://avatars0.githubusercontent.com/u/614881?v=3","gravatar_id":"","url":"https://api.github.com/users/sixhat","html_url":"https://github.com/sixhat","followers_url":"https://api.github.com/users/sixhat/followers","following_url":"https://api.github.com/users/sixhat/following{/other_user}","gists_url":"https://api.github.com/users/sixhat/gists{/gist_id}","starred_url":"https://api.github.com/users/sixhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sixhat/subscriptions","organizations_url":"https://api.github.com/users/sixhat/orgs","repos_url":"https://api.github.com/users/sixhat/repos","events_url":"https://api.github.com/users/sixhat/events{/privacy}","received_events_url":"https://api.github.com/users/sixhat/received_events","type":"User","site_admin":false},"created_at":"2017-05-18T10:42:15Z","updated_at":"2017-05-18T10:42:15Z","body":"They are creating the spheres but at different scales, but I think that you need to do a resetMatrix on both canvas. This works. Test it at [codepen](https://codepen.io/anon/pen/ybxwGb)\r\n\r\n```javascript\r\nvar pg;\r\n\r\nfunction setup() {\r\n  createCanvas(100, 100, WEBGL);\r\n  pg = createGraphics(100, 100, WEBGL);\r\n  pg.show();\r\n}\r\n\r\nfunction draw() {\r\n  resetMatrix();\r\n  background(128);\r\n  sphere(100);\r\n\r\n  pg.resetMatrix();\r\n  pg.background(128);\r\n  pg.sphere(100);\r\n}\r\n```\r\n\r\n\r\n"}}
{"actor":{"display_login":"sixhat"}}