www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: hytparadisee on June 13, 2007, 05:55:21 pm

Title: WARNING: Texture coordinates are not within the allowed range (0f-1f)
Post by: hytparadisee on June 13, 2007, 05:55:21 pm
any idea what is causing this kind of error when loading md2 models? I get this error on every md2 model i created on my own. And recent incidents cause the program not running at all. This warning just keep printing on new lines forever.
Title: Re: WARNING: Texture coordinates are not within the allowed range (0f-1f)
Post by: EgonOlsen on June 13, 2007, 06:15:10 pm
The loader is giving you this warning, because...well...the warning text says it all. The MD2-format defines them as [0-1[...i have no idea why your MD2-models have different coordinates. It uses the skin's width and height (also stored in the file) to calculate them. So i would guess one of them is wrong. But it's just a warning, the coordinates will be added anyway. You may try to set the Logger to LL_ONLY_ERRORS to suppress the warning and see if the application will at least load the model.
Title: Re: WARNING: Texture coordinates are not within the allowed range (0f-1f)
Post by: hytparadisee on June 13, 2007, 06:20:22 pm
Alright thanks, the model can be loaded. I thought the application hangs but that's not jpct's problem, it's actually netbeans' problem ;D. But im still not sure about the textures i will check them out later.
Title: Re: WARNING: Texture coordinates are not within the allowed range (0f-1f)
Post by: hytparadisee on June 13, 2007, 08:50:48 pm
Quote
But it's just a warning, the coordinates will be added anyway.

Hey Egon, just let you know that my problematic model works well in openGL model, even if the textures are wrong, they still displayed correctly. The true problem is with software mode. When in software mode, the textures are all messed up.
Title: Re: WARNING: Texture coordinates are not within the allowed range (0f-1f)
Post by: hytparadisee on June 13, 2007, 09:05:12 pm
Accompanying shots:

I have to admit, both are *cool* :P, and it's only 320 polys

(http://peterhi.com/resources/images/20070614/MD2TextureCoordsGL.JPG)
::) in AWTGLCanvas mode. This is mapped correctly.



(http://peterhi.com/resources/images/20070614/MD2TextureCoordsSW.JPG)
::) This one messed up (in s/w mode)
Title: Re: WARNING: Texture coordinates are not within the allowed range (0f-1f)
Post by: EgonOlsen on June 13, 2007, 10:30:49 pm
Try to call build() on that model after assigning the correct texture to see if that helps.
Title: Re: WARNING: Texture coordinates are not within the allowed range (0f-1f)
Post by: hytparadisee on June 14, 2007, 08:29:24 am
Thanks, that one works. So in the end, it's just a warning.

Yeah, that's my mistake, i applied the textures after calling world.buildAllObjects().
Title: Re: WARNING: Texture coordinates are not within the allowed range (0f-1f)
Post by: EgonOlsen on June 14, 2007, 08:40:38 am
How did you create that MD2s? As said, the format doesn't allow for coordinates below 0 or larger than 1.
Title: Re: WARNING: Texture coordinates are not within the allowed range (0f-1f)
Post by: hytparadisee on June 14, 2007, 03:10:02 pm
Egon. Please see my post at:

http://www.jpct.net/forum2/index.php/topic,878.0.html (http://www.jpct.net/forum2/index.php/topic,878.0.html)