# Ideas and suggestions needed for Improving p5.js WebGL mode in GSOC 2019

**URL:** <https://discourse.processing.org/t/ideas-and-suggestions-needed-for-improving-p5-js-webgl-mode-in-gsoc-2019/8865>\
**Category:** Summer of Code\
**Created:** [March 2, 2019, 8:34pm UTC](https://discourse.processing.org/t/ideas-and-suggestions-needed-for-improving-p5-js-webgl-mode-in-gsoc-2019/8865 "2019-03-02T20:34:51Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![sanketsingh24](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@sanketsingh24](https://discourse.processing.org/u/sanketsingh24)\
**Post date:** [March 18, 2019, 5:55pm UTC](https://discourse.processing.org/t/ideas-and-suggestions-needed-for-improving-p5-js-webgl-mode-in-gsoc-2019/8865/12 "2019-03-18T17:55:54Z")

</div>

Hey @jeremydouglass, Thanks for the reply! And Sorry I could not answer earlier,

> [@jeremydouglass](#):
>
> `startCamera` and `stopCamera` don’t make sense to me for time-based camera orientation events or path animation. p5.js animation fundamentally occurs in the draw loop – you can’t delay on one line and then execute the following line five seconds later, it doesn’t work that way. You have to be able to execute all the lines in draw every frame that renders to the screen.

Ok, I firmly agree with you on this point. I think that’s right.

> [@jeremydouglass](#):
>
> If you want to do path-based interpellation over time, then it would normally look like `frameCount` or `millis()` driving p5.Vector.lerp(), something like this:

I got the idea upon [seeing this example](https://p5js.org/reference/#/p5.Camera), and I thought about the problems which can arise, some of which are seen in the link you gave →

> [@jeremydouglass](#):
>
> This also gives you the freedom to decide whether you want to implement your lerp based on frame-independent input (millis) or frame-dependent input (frameCount), as these kinds of motion can give different results on different devices ([WebGL - Animation](https://webglfundamentals.org/webgl/lessons/webgl-animation.html)).

I think using millis is probably a better idea, as it doesn’t depends on fps drops. Its implementation is the same as I would have implemented.

> [@jeremydouglass](#):
>
> An idea: If you wanted to create an advanced feature for managing timed camera movement, then one approach would be a CameraAnimation object that stores a series of frame-stamped camera matrices then can interpellate them and return a camera when passed a frameCount. You would program it with the standard camera methods (setPosition, lookAt) that took an additional time argument, and these would be used to generate its timestamped camera matrix stack.

I think this is a bigger Idea, and I won’t be able to complete my project in time If I would proceed to implement them ☹.

I think what I proposed can already be done, So there is no point implementing it. I [asked](https://discourse.processing.org/t/doubt-rendering-camera-methods-after-a-certain-time-interval/9313) before the same question, but nobody answered, so I thought it is not possible. `millis()` can also be used for the camera related method, And while proposing this, It just didn’t come to my mind, I am extremely sorry for that.

---

_[View the full topic](https://discourse.processing.org/t/ideas-and-suggestions-needed-for-improving-p5-js-webgl-mode-in-gsoc-2019/8865)._
