Hello Guest

First person camera and texture mapping

  • 4 Replies
  • 6692 Views
First person camera and texture mapping
« on: March 13, 2011, 14:08:12 »
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)

Re: First person camera and texture mapping
« Reply #1 on: March 15, 2011, 17:12:03 »
Somebody answer me??

Re: First person camera and texture mapping
« Reply #2 on: March 18, 2011, 22:07:09 »
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.

Re: First person camera and texture mapping
« Reply #3 on: March 19, 2011, 19:09:28 »
http://slick.cokeandcode.com/javadoc-util/org/newdawn/slick/opengl/TextureLoader.html  Just pass false or true for "flipped" variable to see which one makes it not inverted.
cool story, bro

Re: First person camera and texture mapping
« Reply #4 on: March 22, 2011, 13:10:14 »
Problem solved. Thanks.