Comments (8)
You accidentally posted your sketch.js twice instead of your raindrop class.
I think you might be able to work around this by pushing and popping your raindrop object to an array and drawing that array. I also opened an issue that worked in the p5 online simulator, so maybe our problems are related.
from react.
Thanks! fixed that.
from react.
I am running into the same problem as you are now and I tested my suggestion of using an array, but I realized that it does not have any effect. What is interesting is that they are not all independent objects, they are only left over images of where the object used to be.
from react.
I believe that this is not only a problem with objects but also regular p5 drawings such as in this example.
p5.draw = function () { p5.ellipse(p5.mouseX, p5.mouseY, 30); }
Rather than having a circle follow my mouse as it should, it leaves a trail of circles as shown here.
from react.
Question, do you clear the FrameBuffer on the beginning of the new draw cycle?
e.g. with setting the Background?
https://github.com/and-who/react-p5-wrapper/blob/2275f7972522b8b6a449a5cea2e1a79e9acb5d3b/example/src/sketches/sketch.js#L15
from react.
Funny enough, i've just tried that and it works now.
Can you explain me why?
from react.
I assume the following, since it works in other GraphicSystems similar.
p5 stores the calculated Image in an FrameBuffer.
To clear the Frame Buffer would be additional operations, so why not keep it, because you could use it in your next Frame.
I actually have an Example how you could use it :D
On my Webpage I create a nice Effect by drawing with some Transparency over my last rendered image and moving the circles a bit:
http://wolfandreas.com/
from react.
Wow! Thank you. I think this issue can be closed now. This makes total sense now.
from react.
Related Issues (20)
- Duplicate canvas when running in vite dev HOT 5
- TypeError: p5.loadSound is not a function HOT 4
- P5-wrapper size HOT 5
- Stop rerender of p5 component when redux variables update HOT 3
- Latest commits not in the npm registry HOT 5
- Issue building with Vite 5 HOT 16
- npm ERR! Usage Error: This project is configured to use npm HOT 2
- windowResized() not firing HOT 4
- Error in nextjs HOT 7
- Change p5 dependency version to minimum 1.4.1 HOT 9
- Examples directory doesn't exist, link broken on README HOT 3
- Module parse failed: Identifier 'XX' has already been declared (7762:41) HOT 3
- Is this package supported in React Native? HOT 1
- How to access custom props using abstracted updateWithProps
- Custom updaters as props for use in abstracted methods
- Missing typings for `ReactP5WrapperGuard` in 5.0.0-rc.0 HOT 2
- npm package for version 4.4.1 is empty HOT 3
- It creates new canvas once state is changed HOT 4
- How can I use @P5-wrapper/react in react native HOT 1
- drawingContext is not definied HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react.