7 Replies - 3961 Views - Last Post: 18 March 2013 - 02:19 PM Rate Topic: -----

#1 luckielordie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 18-October 11

DirectX 11 and Wavefront .OBJ Files

Posted 18 March 2013 - 03:51 AM

Hey guys.

I have to write a parser for .obj files as part of an assignment. Dw I'm not asking for answers to that (I already have written one!)

My question is what happens when I try to send the data to the graphics cards at the minute I send the data using the call

deviceContext->DrawIndexed( numIndice, 0, 0 );



Now the problem is this call only takes one Indice list whereas .obj stores 3 sets of indices; Normals, Vertices and UV Tex. Do I have to sort the data into vertex structures when I read it in? This is the confusing part because it seems like that would be quite a costly operation.

I'm using this structure currently
struct SimpleVertex
	{
		XMFLOAT3 Pos;
		XMFLOAT2 Tex;
		XMFLOAT3 Norm;
	};



Anyway I'm rambling. If you know any articles on the topic or any other calls I should be using or just general arrangement of data. Let me know.

Is This A Good Question/Topic? 0
  • +

Replies To: DirectX 11 and Wavefront .OBJ Files

#2 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: DirectX 11 and Wavefront .OBJ Files

Posted 18 March 2013 - 07:11 AM

Have you checked out the documentation from Microsoft? That is the goto for such information.
Was This Post Helpful? 0
  • +
  • -

#3 luckielordie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 18-October 11

Re: DirectX 11 and Wavefront .OBJ Files

Posted 18 March 2013 - 11:09 AM

View PostButchDean, on 18 March 2013 - 07:11 AM, said:

Have you checked out the documentation from Microsoft? That is the goto for such information.


Yeah that was my first port of call. Although it would be nice to hear from people who have used DX11 before. I'm a second year games programming student so I don't have much xp on the subject.
Was This Post Helpful? 0
  • +
  • -

#4 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: DirectX 11 and Wavefront .OBJ Files

Posted 18 March 2013 - 12:11 PM

The way that I learned was to try and see what happens. In real world of programming games that's how it is, so get used to it. :)
Was This Post Helpful? 0
  • +
  • -

#5 luckielordie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 18-October 11

Re: DirectX 11 and Wavefront .OBJ Files

Posted 18 March 2013 - 01:05 PM

View PostButchDean, on 18 March 2013 - 12:11 PM, said:

The way that I learned was to try and see what happens. In real world of programming games that's how it is, so get used to it. :)/>


No doubt. I'm not debating it. But if someone with some knowledge would like to help me out I'm not gonna turn down a chance to listen to someone who has a working experience with the tech.
Was This Post Helpful? 0
  • +
  • -

#6 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: DirectX 11 and Wavefront .OBJ Files

Posted 18 March 2013 - 01:37 PM

Well think about it. you said in your first post that you're not looking for answers. What do you have versus what the call to DrawIndexed() requires?
Was This Post Helpful? 0
  • +
  • -

#7 luckielordie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 18-October 11

Re: DirectX 11 and Wavefront .OBJ Files

Posted 18 March 2013 - 01:41 PM

View PostButchDean, on 18 March 2013 - 01:37 PM, said:

Well think about it. you said in your first post that you're not looking for answers. What do you have versus what the call to DrawIndexed() requires?


I have three sets of indices. One for Vertices, Indices and Normals. My question is is it better to sort the data into structs when I load the data in. Or is there some sort of method in DX11 that takes triangles? My only reference point for this is OpenGL GLUT libraries.

Sorting the data seems like a lot of wasted time to me.

What do you think?
Was This Post Helpful? 0
  • +
  • -

#8 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: DirectX 11 and Wavefront .OBJ Files

Posted 18 March 2013 - 02:19 PM

What do you know of triangle strip and triangle fan? Have you seen anything in the docs that require organization?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1