Author Topic: how to import File "X" directx in Autocad ?  (Read 2677 times)

0 Members and 1 Guest are viewing this topic.

bikelink

  • Guest
how to import File "X" directx in Autocad ?
« on: December 01, 2009, 05:25:53 AM »
Hi, I would like to write a simple converter from/to directX and autocad . Did  someone  experience about it ?

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: how to import File "X" directx in Autocad ?
« Reply #1 on: December 01, 2009, 08:52:26 AM »
DirectX is a platform for handing graphics, not a data type, so I don't see how you can convert between the two ... that would be like saying you want to convert Windows XP to a bitmap .. it just can't be done .. unless you mean you want to convert DirectX data into AutoCAD data and export AutoCAD drawings so they can be utilized by DirectX ...

Regardless, I am not familiar with DirectX so I am sorry I can't offer advice beyond what I already have.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

MickD

  • King Gator
  • Posts: 3640
  • (x-in)->[process]->(y-out) ... simples!
Re: how to import File "X" directx in Autocad ?
« Reply #2 on: December 01, 2009, 02:38:27 PM »
autocad uses DirectX or OpenGL (depending on your hardware configuration) with DirectX being the prefered choice. Most likely if your card isn't supported your graphics are processed in software (a software implementation of DirectX/OpenGL) in the pc's cpu rather than being fed to the video card processor and is therefore a lot slower.
In the very depths of the graphics interface within autocad the geometry data is being passed to the video context (i.e. DirectX) to transform the data to pixels on the screen so somewhere your data is being fed to DirectX anyway, it's just the way the acad db/graphics works (and it has to work that way for the graphics user interface to play as expected) that makes it slower that just feeding vertex data straight to DirectX.

To write a 'simple' converter would not be a trivial exercise but there are some gaming file formats that you could start with and I'd look at exporting to dxf then to a 3d file format then use something like blender to view the data.
hth.
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

MickD

  • King Gator
  • Posts: 3640
  • (x-in)->[process]->(y-out) ... simples!
Re: how to import File "X" directx in Autocad ?
« Reply #3 on: December 01, 2009, 04:00:36 PM »
Maybe a better way to put how images are sent to the screen as pixels may help.

All applications get sent to the video card else we couldn't see them. Most, such as Windows, do the grunt work of converting geometry to pixels in 'software' mode which is calculated by software on the host pc using it's processor where as when an application uses DirectX is is sending the raw geometry straight to the video card processor which is highly optimised for graphics processing which converts the geometry to pixel data.

Once this pixel data is created it is sent to a 'buffer', again this may reside on the pc or the video card with the video card being the faster choice.

With so many configurations/brands of video cards you can imagine how hard it would be to write code that would suits all, but most OS's have a 'coupling' dll if you like that makes the choice on the fly whether video card processing is available or not for the application, also, the application can do a search for compatable hardware and bypass this coupling if need be to improve performance.

hth.
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

bikelink

  • Guest
Re: how to import File "X" directx in Autocad ?
« Reply #4 on: December 22, 2009, 04:36:04 AM »
of course "mesh data"... of File .X and not images.
file x are list of vertex...Now I Must know how it is structured..

MickD

  • King Gator
  • Posts: 3640
  • (x-in)->[process]->(y-out) ... simples!
Re: how to import File "X" directx in Autocad ?
« Reply #5 on: December 22, 2009, 03:38:57 PM »
Ahh, I see there is a directx .x file, yes, you'll need to find out how to feed the out the acad mesh to store as a .x file.

Maybe this will help if you haven't already seen it - http://www.mvps.org/directx/articles/d3dxmesh.htm
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien