See p5.play
In p5.play there is a camera function that allows the user to move around what part of the sketch they are looking at. I figured out that even when the camera is moved the mouseX/mouseY are still relative to the “screen” and are not affected. this is an easy fix, just add the displacement into a new variable. But, the camera also has a zoom feature, how would I find the function/equation to remove the displacement
BUMP____the bump then bump_______________________________________.
In the above link in the main page, AWSD allows to control the rocket. Press k
to fire
You are zooming using the camera property, right? This means you ahve control of the zoom. Based on this:
You know how to fix the displacement when the zoom is 1. If you have a zoom of 4, the a displacement of value dx should be corrected by the zoom factor. You do this by calculating: dx_unzoom = dx / zoom
whee zoom is 4. If this does not answer your question, please provide some code showing your initial approach for this corrections.
Kf
1 Like
I will try it and get back to this thread thanks