Comments (2)
Some thoughts:
- Matter.js has something similar like a camera because in the Renderer you can set what the renderer should look at
- But if I understand correctly we are using P5 as a renderer, so that functionality is not available to us
- If I understand the example @b-g posted correctly, they are just using translate and scale on the canvas context to simulate a camera
- We could produce a similar result with push/pop as this apparently is what p5 is doing under the hood anyways
- I don't know how well this would translate into a class though ... as the push would have to happen at the beginning of the draw and pop at the end
- For the parallax example I now used push & pop without a camera class and it works fine (and is in line to what the folks have learned in the rest of the semester) ...
- ... but I'd imagine that it would interfere with coordinates from mouse input, like in 6-add-remove-bodies (but I have not verified how mouseX/mouseY works in combination with push/pop/scale)
- I think the fundamental problem is that p5 doesn't have the concept of viewports/cameras
- It's quite sad, because in game engines like in Godot this is basic stuff
→ I am not sure how feasible it is to add a camera class with our P5 + Matter setup :(
(At least one which doesn't interfere with mouse input and/or isn't super weird to use ... or am I missing something?)
from p5-matter-examples.
Nevertheless, ground work can be found in the new camera follow example.
from p5-matter-examples.
Related Issues (11)
- Assets
- Multiple bugs with PolygonFromSVG HOT 2
- Magnet class doesn't behave like a magnet HOT 2
- Add soft body example
- Bump p5.js to latest version (v1.6.0) HOT 1
- Fix to PolygonFromSVG.js introduces bug
- Matter wrap
- matterObj in scrollFollow Funktion
- Example 6-sprites-canvas-sandwich has wrong link from main page HOT 1
- Improve docs: document all methods of each class 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 p5-matter-examples.