Sign in to follow this  
CTPAX

md2 modle loading

Recommended Posts

CTPAX    122
Can anyone help me with some quake2 modles loading? I've found one source and it loads model ok, but texture's all mixed up... I have no idea how to make it work, I've tried with couple of things and nothing.

Share this post


Link to post
Share on other sites
Stoic    368
Hi -

It's been awhile since I've looked at this stuff in my own system, but I seem to recall that MD2 stores its UV coordinates in image space with the origin in the Upper left (pixel start), rather than the Lower Left (which OGL uses).

The code to fix this would look something like -

foreach (UV in Mesh)
{
UV.v = 1- UV.v;
}

I can't be sure this is your problem, but it's a common one. Good Luck.

Share this post


Link to post
Share on other sites
CTPAX    122
Ok, thanks, but since nobody answered me right away, I've sit down and find that myself... Ihave somebody else's code, but it has that mistake... I don't know how can somebody publish code with a mistake like that... Thanks anyway, you had a resolution for the problem...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this