Jump to content
  • Advertisement
Sign in to follow this  
UselessRob

OpenGL ms3d in directx? Basic drawing queries

This topic is 4935 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

Hey folks I've been using OpenGL for years, but since I mainly make Windows programs I thought that it made sense to at least give DirectX a go. But I'm having trouble getting my head round it after being so used to OpenGL, so I have some sad newbie questions. Sorry if these have been answered, but the forum search is disabled at the mo. What I'm sort of struggling with is just basic drawing. I want to display a Milkshape3D model, as I do a lot under OpenGL. However, as under GL I'd just go thru and draw the triangles, I can't seem to work out how to do that under DirectX. I understand that if you want to use .x mesh files it's easy enough, but what about my ms3d file (or anything else for that matter)? I've tried converting them to x file but it just doesn't do what I want. You see I figure if I can work out the drawing, I can just re-use my main animation code from my old projects. So do I have to go thru the model data and make lists of vertices and triangle indices etc that will then be compatible with D3D's DrawIndexedPrimitive function? Or is there a simpler, less CPU hungry way (I don't really want to make a new array of points for each frame). Geez, I hope this makes sense and doesn't sound too stupid. I've ranted on a bit, but I'm just a little confused about how it's all working. Any help would be appreciated. Please don't hate me because I'm different. :) Rob.

Share this post


Link to post
Share on other sites
Advertisement
Rendering in Direct3D is done through a call to one of the Draw{Indexed}Primitive{UP} family of functions. The most efficient use is via indexed vertex data (mostly triangle lists) - this is equivalent to vertex arrays in GL. If you want a quick'n'dirty method you can just use the Draw{Indexed}PrimitiveUP family of functions, which take a pointer to your vertex data and render them. This isn't optimal most of the time. For more info, check the Forum FAQ.

Share this post


Link to post
Share on other sites
Thanks for such a quick reply, and for the explanation.

I should have checked the FAQ first, and now feel even stupider than the time I licked the hand rail on the train expecting it to taste like butter scotch. :)

Sorry.

Thanks.

Rob.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!