hey i ve got a problem with JOGL(Java + openGL). I have created a hero that the user controls. any ideas how i can make it move to explore an area? till now i have achieved to make him move forward and rotate its body but when it rotates and i press the forward key again it keeps on moving in the same direction as before the rotation but with its body rotated.
Name:
Anonymous2010-04-27 17:17
This sounds like a concept of video games problem, not a JOGL problem (after-all, it's basically just OpenGL all wrapped into a Java class). This may even be just an OpenGL problem.
It sounds like the only thing you are doing is rotating the graphics object but not the movement vector. A good idea is to keep those two concepts separated but indirectly connected.
For example, when you press "Up" you move unit_vector(1.0, 0.0, 0.0); when you turn 90-degrees, pressing "Up" should move you unit_vector(0.0, +/-1.0, 0.0). You need to make that calculation.