Jump to content
  • Advertisement

Archived

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

MrNeedHelp

Simple Question.

This topic is 5465 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a vertex buffer and an index buffer set up . Now , i want to render the triangles using an offset . I mean , if my index buffer is like this : 0 , 1 , 2 , 3 , 1 , 2 How do i render only the second triangle (that indices 3 , 1 , 2) specify in my DrawIndexedPrimitive Call ? I know this is just something as simple as setting an offset parameter but the parameter naming is not very helpful , nor the 1 line sdk explanation . Thx

Share this post


Link to post
Share on other sites
Advertisement
Get the DirectX help files - they have very thorough descriptions of all functions and their parameters, including DrawIndexedPrimitive. This help is also available on the Microsoft site - search on DrawIndexedPrimitive and you should find it.

Also, search the SDK examples for the functions you are using - I''ve figured out much from watching how the SDK examples work.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
start >> programs >> directx sdk >> documentation

Share this post


Link to post
Share on other sites
The docs come in the SDK. I don''t know the file name, exactly (not at that system right now), but look through your SDK directories.

You could also try the Microsoft DirectX page at http://msdn.microsoft.com/library/default.asp?url=/nhp/default.asp?contentid=28000410 . You can download SDK stuff from there.

Share this post


Link to post
Share on other sites
No , if you are refering to the SDK docs they are just good for a reference , nothing more... Anyway , the answer must be veeryy simple , someone must know it !

Share this post


Link to post
Share on other sites
Alright man, I''ll help you because I am the man , but understand that you are forever indebted to me for this.

Before I lay this brilliance on you, I have to tell you that you are being a little ignorant. The SDK is the best resource for programming with DirectX. Period. The answer is not only in there, but it''s also plain as day.

Ahem. Now that I''m done taking your chastity, here''s your answer.


HRESULT DrawIndexedPrimitive(
D3DPRIMITIVETYPE Type,
UINT MinIndex,
UINT NumVertices,
UINT StartIndex,
UINT PrimitiveCount
);

NumVertices
[in] The number of vertices indexed during this call, starting from BaseVertexIndex + StartIndex

StartIndex
[in] Location in the index array to start reading indices.



So for the example you provided, you would want StartIndex to be 3, NumVertices to be 3, and PrimitiveCount to be 1. Got it? Now go make Half-Life 3.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
sad thing is i know how to do it and i haven''t used d3d since 5.0

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!