View Full Version : how to read a .x file using opengl
05-30-2004, 03:05 AM
I have some models which are in .x file.
I want to load them using opengl.
Does anyone know how to do it?
05-30-2004, 03:13 AM
You don't load using OpenGL. You draw using OpenGL. For loading, parse the file (if I remember correctly, it is ascii), and store into ram, then draw using GL.
Edit : google is your friend, here is the file format :
05-30-2004, 03:16 AM
then how to draw them?
I used a text editor to open the .x files,
see some points' coord,
and I think it must have some format.
then how to draw it in opengl
05-30-2004, 03:41 AM
you draw them the same way like you draw any other collection of triangles. if youre looking for a magic "glDrawXFile" function youre out of luck. same goes for "glDraw3dsFile" and "glDrawObjFile". stuffing the geometry into arrays or buffers is your job, not opengls. an no, opengl doesnt automatically play any keyframed animations or does skinning all by itself. if thats what youre looking for then you need a 3d engine.
05-30-2004, 04:33 AM
Then I think I have to write such a function
Is there any code implementing such function?
I have search for some thing like this, and find an article about this topic, but I can't open that page!! :eek:
Does any one so generous to give me any help:>
05-30-2004, 11:54 PM
Originally posted by Rubbish Kid:
I have search for some thing like this, and find an article about this topic, but I can't open that page!! :eek: Isn't it hard to live in China sometimes ?
Try www.wotsit.org (http://www.wotsit.org) for file formats :
Or directly from Microsoft :
05-31-2004, 07:45 AM
Thank you so much
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.