Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Peasy Cam rotation

$
0
0

Hi, I'm trying to create a button that rotates my object perfectly 90 degrees to the left from it's initiate state.

I made a button that when it is triggered, it will execute the following code.

cam.reset(); // Resets the camera so that the object is in its initial state.
cam.rotateY(-PI/2); // cam.rotateX(-PI/2);

However, every time I press the button, cam.reset() will be executed but not rotateX(). And when I execute rotateX() by itself, it works. Hence, I think that it is the cam.reset() that nullifies the rotateX() that comes after it.

Does anyone know a way to prevent this from happening? Or does anyone know how to reset the 3d object to its initial position without using cam.reset()?

Thank you so much, Jerry


Viewing all articles
Browse latest Browse all 2896

Trending Articles