I’m looking for a way to interact (preferably mouseOver) with ellipses here: http://dev.furu.studio/sandbox/p5js/ .
I tried using libraries from https://p5js.org/libraries/ but they do not work with 3d. I tried using createGraphics() but it destroys my CPU.
Does anyone have an idea how to implement this interaction?
Basically when you draw the ellipses (with all translate and rotate in place) zse screenX and screenY to store its 2D position
check this position against mouse pos
Thanks for the fast reply. I will try to implement it right away and let you know about the result. Cheers!
@Chrisir so I tried to implement the solution you mention but it seems I may be doing it wrong.
As you can see in the editor below the ellipse is positoned correctly relative to the center of canvas but the coordinates it is getting from screenPosition() when checked against mouseX/Y are relative to the 0,0 screen corner (you can trigger the color change by hovering your mouse around the top left corner instead of the object itself).
Can you point out what I am doing wrong?
use text() to show the value of b0 - seems always to be of value 0
Thanks for the tip. screenPosition works great but in my case it required some additional computation which I added in the editor. Thanks again @Chrisir. Marked as resolved.