Alejandro Saez (cano++at++krusty.engr.sgi.com)
Fri, 10 Oct 1997 13:25:12 -0500
To my knowledge, you can't... I mean directly. DXF is an autocad interchange
format and textures are not feature of the format definition. What you can do
is convert the DXFs to some other format that supports textures and then apply
the textures using a modeler for that format. Multigen comes with a dxf2flt
converter and the Polytrans converter can also import DXF and export to many
texture capable formats. You could always hard code the mapping while parsing
the files but I don't really think is a good idea.
About the normals, you could read the edges forming a 3DFACE (a DXF
primitive) and calculate the normals. There is a shareware CAD program called
xmgf that comes with a DXF filter (a program, source code included, that parses
DXF files) and the dxf format specification. I used that to read DXFs and draw
them using OpenGL and took very little time to do it. But then, DXF is supposed
to be an INTERCHANGE format (autocad really uses DWG) so maybe is a better idea
to use it as such, and convert your files to a more suitable format and do the
work there.
One last thing, I don't really know what you want to use the DXF for,
but maybe you could check OpenGL Optimizer, which is design to visualize CAD
files, optimizing the files for real-time rendering. That's about what I know
about OpenGL Optimizer but maybe you could see if it fits your needs.
--
------------------------------------------------------------------------
Alejandro Saez
Software Engineer
Silicon Chile S.A.
Avda. Santa Maria 2560
E-mail: asaez++at++silicon.cl Providencia
Phone: +56 (2) 203 3371 Ext. 107 Santiago
Fax: +56 (2) 203 3370 Chile
------------------------------------------------------------------------
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:57:42 PDT