I have still not had the time to place all the links to the code samples on this page. There are many more samples on the Assignments page.
I have been building a FPS gaming engine using Java to use as a sample for students to learn from. Make sure you check it out (FPS370).
Here are the samples from the network lecture last night.
I modified the FPS sample and added mouse movement. I also change the keyboard to be closer to the standar FPS pc game. I purposefully avoided any of the standard Java mouse behavior and handled movement at a much lower level to give you the most control in your own games. I forced the mouse to stay in the center of the screen. This is also common in non-java apps, but the mouse should be hidden. It is a simple thing to do and I'll leave that up to you to either implement or ask how.
Added a sample that shows how to implement yaw, pitch and roll movement. There is a decent comment at the top of the Tmpl3Panel.java file that describes the functionality. Basically you have to base the movement on your current orientation. For pitch, you take a vector along the x axis (1,0,0) and transform it with the current orientation transformation matrix. Use that to create an AxisAngle with a rotation in the direction you want (forward or backward pitch) and use that to create another transformation. Then multiply your orientation transformation (t3dYPR) by that transformation and that adds the pitch.
I added a sample for picking. Point the pick ray at a cube and push space. The cube moves away from the view. The same controls as the other sample. Space moves the closest cube in the pick path.
CPSC370 - Games Development
Instructor: W. Wood Harter
(c) copyright 2006 - W. Wood Harter - All Rights Reserved
Screen shots on banner (c) copyright their resprective owners