Is there a straightforward way of mapping a panoramic image to the interior of a sphere, squeezing the upper and lower ends, so that it surrounds the viewpoint?
I can do it for a cylinder and will make do with this if I have to, just wanted to see if there was a more elegant solution.
I have a class which basically just displays an image, and that's stored in an ArrayList. When the user mouses over the image, that one vanishes and a new one appears elsewhere. I'd like the image to fade out on a mouse hit test before the new one appears, but I'm having trouble implementing this.
The display function in the class is basically just:
void display() {
tint(255, opac);
image(target, x, y);
}
And I have the ArrayList call 'remove' on a successful hit test, followed by adding a new instance of the class where 'opac' is reset to 255. What I'm not sure about is where to put an 'opac = opac - 5;' line to get the image to fade out, and THEN have the new one called.
Obviously it won't work outside draw(), but I don't want it triggered until the hit test is successful, and then need opac reset to 255 for the new instance. Any thoughts?
This may be elementary, but I'm trying to create an effect similar to pmouseX/Y, where data is stored into a variable (a float, in this case) from the previous frame, but for the X/Y coordinates of something other than the mouse. I need the previous frame's data stored in a variable that updates in draw().
Any thoughts on the most elegant technique for doing this?