Archived

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

Limal

From MilkShape3D to Direct3D without .x files

Recommended Posts

I want to use MilkShape3D, but first I must convert model from .ms3d format (right-handed, like OpenGL) to left-handed coordinate system (intelligible for Direct3D 8.1). I wondering how can I do it? If Anyone know, please give me solution. I''ll be intebted. PS. In program "Skeletal Animation Tutorial" (Real SOON Now - Brett Porter) is used header , in header delivered with MilkShape3D SDK - isn''t. Why? I think it have link with "char" type in C++. PS.2 I want to using .ms3d format because it is very economical. The .x files can be 5x bigger than .ms3d file.

Share this post


Link to post
Share on other sites
to convert the coordinate system, while u r reading the vertex indexed list, read every triangle from CW to CCW, for example, from 0,1,2 to 0,2,1.

in your rendering routine, negate the final Z value (z=-z). (if playing animation, negate after transformed)

that''s it, i use this method in my engine, hope this help.

Share this post


Link to post
Share on other sites
Thank You for fast reply.

In my converter (build in Borland C++ Builder) I switch verticies and negate Z.

I have a question:

I must negate also Z-normal.

-pGroup.pVertex[ID[j]].normal[3];

?

Share this post


Link to post
Share on other sites