Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Jayce

MD2 rendering

This topic is 6076 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi ya''ll, I''ve been busy creating this little MD2 loading class. Works pretty well but I can''t get the glCommands to work properly when rendering the model. I''m using Delphi 6 here and it seems the u,v coords aren''t properly set. They should be between 0 and 1 but I suspect Delphi to mess up the typecasting from integer (4 bytes per integer) to single (also 4 bytes). I know this works in C/C++ but I want to use Delphi. Anyone knows how to solve this one? Bye, Jayce P.s Oh, and please don''t go saying I should use C/C++, that doesn''t help very much. :-)

Share this post


Link to post
Share on other sites
Advertisement
use c++
hehe soryr man i have no idea
and umm shouldnt u be using floats for numbers which have a decimal point?

Share this post


Link to post
Share on other sites
quote:
Original post by Do00d
and umm shouldnt u be using floats for numbers which have a decimal point?


''single'' is the Delphi/Pascal type corresponding to ''float'' in C/C++.

Regarding the original question: I don''t know much about delphi, but are you reading the tex-coords as integer and then casting them to single? If that is the case you will most certainly get strange tex-coords since everything will be rounded (or truncated) to the nearest integer. Try reading in the values as single in the first place (don''t know how to do this in Delphi, but it shouldn''t be difficult).

If the tex-coords are stored in the file as integers, then read them as integers and use the glTexCoord2i or similar functions to pass them to OpenGL.

Share this post


Link to post
Share on other sites
Yeah Dactylos, I was reading the data as integers while I should be reading them as singles. So you''re right here. I fixed it and everything works fine now. :-)

Later!
Jayce

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!