Advertisement

Alpha- I'm having some problems with texture mapping and time based movement.

Started by November 28, 2002 11:54 PM
3 comments, last by alphacentric666 22 years, 3 months ago
Its been a hectic week for me. Usually I don''t ask for help but I''m desperate. I''ve been following tutorials from both gametutorials.com and nehe.gamedev.net regarding OpenGL. I know how to set up a camera. I know enough about 3D Vectors and the equations that need to be perform in order to strafe, move forward, backwards, and rotation. But ever since I added timebased movement to my program. Things went downhill from there. I created a function called "CalculateFrameRate". Not in the mood to post an exert from that function right now(PC acting fuzzy). But its an exact replica of the gametutorials.com function, but yet it doesn''t perform well. Instead of the camera moving 1 step at a time on the axis. It moves like 20,000 steps. Very weird glitch. At first I thought this was some kind of freak accident. So while I was angry I wanted to program my pain away(sounds weird, I know). So I moved on to texture mapping. I memorized everything thoroughly. But just when I thought things would get better. The bitmap wouldn''t load onto my program. All I see is a blank yellow 2D rect in 3D space. Since I can''t upload my program(its all in a .zip file) onto this topic. Respond to this topic by posting your e-mail in here so that I can e-mail you the 106kb .zip file. It contains my executable, some source code, a single .bmp(the one I''m trying to load), and the glaux.dll "A programmer being told to ''''go to'''' hell sees the ''''go to'''' part of the sentence as the bad part."
"A programmer being told to ''go to'' hell sees the ''go to'' part of the sentence as the bad part."
With regards to time based movement, the gametutorials version does contain a minor glitch, if the player or camera is moving before a frame Interval is calculated e.g. at the begining of program execution, an insane value will be applied to your movement translations. To compensate for this stall all animations by 1 to 2 frames depending on when you call calculate_frame().

With regards to the second problem have you checked that your using glTexCoord to map the texture onto the quad, its a very common mistake to forget that you have to manually map a texture onto a shape in order for it to be drawn.

Hope this helps, Kiel

----------------------------------------

www.lancs.ac.uk/ug/gilleade "Silent Beginnings"
gilleade@hotmail.com
Advertisement
Your first solution makes sense. I''m going to try it.

As for the second one, I''ve been using glTexCoord.

"A programmer being told to ''''go to'''' hell sees the ''''go to'''' part of the sentence as the bad part."
"A programmer being told to ''go to'' hell sees the ''go to'' part of the sentence as the bad part."
Is the size of your bmp a power of two .... 2 4 8 16 32 64
If your texture is not a power of two it will show up white.
The width and height of the image is 128

"A programmer being told to ''''go to'''' hell sees the ''''go to'''' part of the sentence as the bad part."
"A programmer being told to ''go to'' hell sees the ''go to'' part of the sentence as the bad part."

This topic is closed to new replies.

Advertisement