Hey guys. Just last Friday I started really working on P3D for a simple FPS RPG that I want to make. The first thing I'm starting with is a free-looking, free-moving camera controlled by the mouse and WASD keys(like you see in many games). I'm using the Robot Java class to keep the mouse in the center and record its movements, but I'm having issues with grasping the concepts of the camera class. I get what eye, center, and up do, but I cannot figure out how to manipulate center and eye well. I have studied the camera manipulations of Chrisr/polar's first person program extensively: http://www.openprocessing.org/sketch/25255 and another first person dungeon generator by RyanD: http://www.openprocessing.org/sketch/23227
I can kind of paste their code and patch it to work with mine, but I don't want to do that because it feels like I haven't earned the end result. I have also looked all around on Wikipedia, tried to study matrices, and looked around on this forum a lot but cannot find a thorough, easy to understand explanation. The Peasy Cam library isn't really meant for first person camera rotation, and I want to avoid libraries if I can for the sake of learning. I've been trying to figure this out for days and I don't know if I'm just impatient, or inexpirenced. So my question is: are there any solid references to documentation, or books, regarding the trigonometry and processes behind 3D rotation? Any replies are appreciated.
Hello all! I'm fairly new to processing and need some help with collision. I am trying to figure out how to make the ball correctly bounce off of the paddle and the walls. I have looked at the pong example game and it helps but I can't grasp how collisions work in programming. Any help with my code or explaining how collisions work would be appreciated. Sorry about the lack of objects but I tried to keep the code as clean as possible. Any responses are appreciated. Here's the code.
int paddleWidth; int paddleHeight; int paddleX; int paddleY; float paddleSpeed;
int ballRadius; float ballX; float ballY; float dirX; float dirY;