LWJGL
May 22, 2013, 23:36:37 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.9.0 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: First person camera and texture mapping  (Read 1802 times)
alex55
Newbie
*
Posts: 3


« on: March 13, 2011, 07: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? Huh (Source code included)
Logged
alex55
Newbie
*
Posts: 3


« Reply #1 on: March 15, 2011, 10:12:03 »

Somebody answer me??
Logged
CodeBunny
Nerdus Imperius
*****
Posts: 561



WWW
« Reply #2 on: March 18, 2011, 15: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.
Logged
jediTofu
Prolific Timewaster
****
Posts: 280



« Reply #3 on: March 19, 2011, 12: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.
Logged

cool story, bro
alex55
Newbie
*
Posts: 3


« Reply #4 on: March 22, 2011, 06:10:14 »

Problem solved. Thanks.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!