First person camera and texture mapping

Started by alex55, March 13, 2011, 14:08:12

Previous topic - Next topic

alex55

Hi!
I made the first person camera from this tutorial, but the texture on the objects were placed inverted. To obtain the texture I used the stick-util library. Also, when I try to move the camera up (position.y += distance), the camera moves down, but the objects are positioned correctly (the object at 0,2,0 is higher than the object at 0,1,0).
What I did wrong? ??? (Source code included)

alex55


CodeBunny

Not sure, but my initial opinions are:

Camera: Consider glTranslate. After it's been used, every operation is shifted by that much. That means to move a perceived viewpoint, you want to translate in the opposite direction you are wanting to move (i.e., use negative values). Afterwards, things that are offset by that amount are that much "closer" to the viewpoint.

Textures: I think you have to pass Slick-Util a parameter in the texture loader to stop texture inverting, but I'm not sure. Take a look at the docs.

jediTofu

cool story, bro

alex55