Sign in to follow this  
Borgleader

C++ Displaying .x models

Recommended Posts

Borgleader    152
Hi, I'm totally new to C++ programming. I started only 3-4 days ago. I bought myself a C++ beginner book and loved it. But more specifically I loved the part about OpenGl. But seeing how many lines it takes just to make a cube, I figured writing the lines of code for any model more complex than a cube or any other primitive would be suicide or at the very least a big waste of time, not to mention that it leaves no space for flexibility. Then came to me the idea of displaying models from external files. I have been playing around with Blender a bit, and I thought that the DirectX file (.x) would be a good file type to use. I was unable to find a way to use this in C++ though. I was wondering if anyone had any links or sample code to help me out. I dont mind if it displays the file in a DirectX or OpenGl window, I would prefer OpenGL as I've worked with it before but it doesn't matter much (if have the DirectX SDK installed on my computer, and I'm using Microsoft Visual C++ 2008 Express Edition (Beta 2)). Thank you, Borg.

Share this post


Link to post
Share on other sites
eedok    982
Haven't used DirectX in a long time, so I don't know if you can still use a MeshBuilder to easily load .x models, but if you want to do it in OpenGL This article may be an interesting read.

Share this post


Link to post
Share on other sites
fitfool    113
woah, your going way to fast... all your doing right now is copy/pasting your code to get your results. You shouldnt even be thinking about opengl for a couple of months until you have a good understanding of c++, which in 3-4 days, you can not get.

Share this post


Link to post
Share on other sites
Borgleader    152
I just want a working code to display a 3d model in opengl OR directx in order to play with it (rotation, translation and all the fun stuff). The reasons I want to load the model from a file are quite simple :
1. Its a LOT more flexible
2. Its a much quicker, no code to write all I need to do is export it from blender.

I might also try some effects or wtv else, but being able to load a model file right now is what I want.

Share this post


Link to post
Share on other sites
Borgleader    152
One way or the other, my point was to animate the models using simple transformations, the file can be.x .obj or whatever else you want all I wanted to do was to rotato them, scale them and such.

But anyway, I think I'll go through some of the tutorials on Nehe's website. I've read theyre quite useful.

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