Archived

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

DJVege

Using a dxf file????

Recommended Posts

Hi, I''m new to this forum, so please bear with me. I have an assignment to do, and was wondering if you could help me understand something. The following sentences are what I am having trouble with. "You can either: • generate your objects using 3D Studio Max, MilkShape or some other modelling package, • create the objects yourself by "hand" or • download a polygon mesh off the web. (there are a number of websites where models are available) Which ever of these you choose, the source of your data MUST be acknowledged in your statement of completeness or you will be penalised. The information for the objects must be read from an ASCII text file. A binary file cannot be used. If you have generated your object using an object modelling package there will be some superfluous information included (for example exporting a .asc file from 3D Max will include text that is not necessary to your program). You are to edit this extra information out using any standard ASCII editor before you write the input routine for your program." ------------------------------------------ I have downloaded the .dxf file, but I do not know how to import this and use it in my c++ code. How do I read this file in..and use it etc.. We are using OPENGL (ie. glut) and c++. Thanks for your time. ...DJVege...

Share this post


Link to post
Share on other sites
Use the glParseDXFFile() and glDisplayDXFObject() functions.




But seriously, this has absolutely nothing to do with OpenGL whatsoever. And bothering other people with your homework assigments is not a nice thing to do either. So please, be a good student and ask correct questions in the right forum.

Share this post


Link to post
Share on other sites
Thanks for the tip. And, sorry dude, but the subject is focused on OPENGL...so I just assumed that this was where to post it. And if my gay lectureres are unable to help me, then where else do I look for help. The Net! My main concern is not the assignment, it''s also learning OPENGL and Glut...

...DJVege...

Share this post


Link to post
Share on other sites
May i ask if what course you are doing???

Anyway, we did an assignment last year - where we had to make a room with a fishtank, with a fish in the room... blah blah.
Anyway out specs were the same as yours... we could either
- hard code the objects (ie, lots of Vertex3f()calls or whatever
- create the object (with a 3d package) and load the text file.

But we couldn''t use a 3rd party loader, we had to write our own.
We chose the wavefront obj format (*.obj). So maybe thats what your assignment requires, coz wats the point of having an assignment where you download an object, and use someone elses code to load/display it coz anyone can do it.

With that said, if you want to learn openGL a little more, try to write your own loader!! Look up the dxf format (its pretty straight forward)...
BTW if you want the source for my assignent (the loader) then email me at pwwit1@student.monash.edu.au

Paul

Share this post


Link to post
Share on other sites
Thanks mate...got it all figured out now. I will parse the dxf file into an array of points (x,y,z)..then use glPolygon to create the object...then we have to render it...or something like that...so creating a loader isn''t actually specs. Thanks for the info. And thanks all for the replies.

Oh, and I''m studying IT (soft eng && data comms)
This is a graphics subject!

Share this post


Link to post
Share on other sites
HI!, it happens I''ve been searching for source code for doing exactly what you want to do (converting DXF in OpenGL), could you be nice and make your solution avaiable for me???
Good luck!!

Share this post


Link to post
Share on other sites
Hey guys...it''s a bit tricky to find the format for dxf files! I mean, i can find basic ones...but I can''t find a full explanation on the codes...example (10 = xvalue, 20 = yvalue etc... )
Sorry rodras26, looks like I''m going to transfer to a 3dstudio Max file....if it''s a loader you''re after, there are many on the web.

Share this post


Link to post
Share on other sites