PDA

View Full Version : Texture Displaying Problem



nukem
01-15-2003, 07:11 PM
I converted the mdl loading part of the hlsdk to an easyer using engine/very portable(I use linux) Everything is fine with it but the problem is when I goto display the model it looks really screwed up. Currently my engine blued(I think it was in the init of the test program since the engine doesnt really touch shading and stuff like that yet) Can someone tell me how to fix this?

The model being displayed threw a win32 app using the offical hlsdk engine (http://zonkbonk.virtualave.net/hlload.jpg)
(note since I cannt compile win32 programs on linux my engine is on frame 0 while the win32 program is on animation 1)
The same model being displayed in my engine (http://zonkbonk.virtualave.net/ng.jpg)




//my init funtion
void init()
{
glEnable(GL_TEXTURE_2D);
glShadeModel(GL_SMOOTH); // Enable Smooth Shading
glClearColor(0.0f, 255.0f, 0.0f, 0.5f); // Black Background
glClearDepth(1.0f); // Depth Buffer Setup
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
glDepthFunc(GL_LEQUAL);
glEnable(GL_LIGHT0); // Quick And Dirty Lighting (Assumes Light0 Is Set Up)
glEnable(GL_LIGHTING); // Enable Lighting
glEnable(GL_COLOR_MATERIAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
}

/*if you would like to see the hole engine feel free to ask*/


Thanks,
Nuke

rgpc
01-15-2003, 08:08 PM
What file format is the texture? Have you tried dumping the texture to the screen (just on a Quad) to be sure you are getting what you expect. (I am assuming there is a problem with the texture - the screen dump makes the entire object look like a great big blob).

I seem to remember there being (common) issues with MD2 loaders (which I think the MDL format is based on) because the textures were PCX (and PCX's are stored upside down?).

If the problem is that the mesh is mashed (ie. It is a blob) then are you sure the animation is 0 based rather than 1 based?

NitroGL
01-15-2003, 10:31 PM
Originally posted by rgpc:
If the problem is that the mesh is mashed (ie. It is a blob) then are you sure the animation is 0 based rather than 1 based?

That's what I'm thinking.