Simple Question.
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
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.
Also, search the SDK examples for the functions you are using - I''ve figured out much from watching how the SDK examples work.
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.
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.
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 !
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement