Written some cool source code? Upload it to Programmer's Heaven.

Read Post

DirectX

Moderators: Sephiroth
Number of threads: 67
Number of posts: 130

This Forum Only
Post New Thread

Report
Question of indexbuffer with matrix Posted by havec on 4 Jul 2008 at 7:42 PM
Hi everyone,
this question make me so depressed. I want to draw a cube with vertexbuffer and indexbuffer. Its ok, but now I want to use Matrix to make cube transformation. The matrix dont work now. I cant use Worldmatrix make transformation, also use View- and ProjMatrix to change Viewport.
( use function DrawIndexedPrimitive(D3DPT_TRIANGLELIST, .......) )No matter how set this three matrix, I can only see one face of cube and this cube is forever in the left-up corner.

But if I render other primitives without indexbuffer, its ok.
( use function DrawPrimitive(D3DPT_TRIANGLESTRIP, .......) )
Why?

I must work out every vertex position with matrix selbst when I use indexbuffer? Or maybe I forget something to set?


Reply
Report
Re: Question of indexbuffer with matrix Posted by gautam on 5 Jul 2008 at 1:46 AM
Whether its Index buffers or vertex buffers it works the same. So if you can show me the code how you are doing it I can tell you what you are doing wrong.

It could be weird if your index buffer is wrong.

: Hi everyone,
: this question make me so depressed. I want to draw a cube with
: vertexbuffer and indexbuffer. Its ok, but now I want to use Matrix
: to make cube transformation. The matrix dont work now. I cant use
: Worldmatrix make transformation, also use View- and ProjMatrix to
: change Viewport.
: ( use function
: DrawIndexedPrimitive(D3DPT_TRIANGLELIST, .......)
: )No matter how set this three matrix, I can only see one face of
: cube and this cube is forever in the left-up corner.
:
: But if I render other primitives without indexbuffer, its ok.
: ( use function DrawPrimitive(D3DPT_TRIANGLESTRIP,
: .......) )
: Why?
:
: I must work out every vertex position with matrix selbst when I use
: indexbuffer? Or maybe I forget something to set?
:
:
:
Reply




corner
© 1996-2008. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin.
bootstrapLabs Logo A bootstrapLabs project.