Skip to main content
gamedev.net
🔒 Locked

md2 modle loading

Started by CTPAX Aug 15, 2008 at 5:54 AM 1 replies 1.4k views
Original Post
CTPAX
CTPAX
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.
Stoic
Stoic
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.

...
CTPAX
CTPAX
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...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.