Click to See Complete Forum and Search --> : Direct X vertex rendering


Erik Wiggins
May 8th, 2004, 09:52 PM
OK I've been fallowing the tutorials that came with the SDK. Needless to say I haven't gotten very far. I can render 1 triangle on the screen but what if I want to rend a second one as well? Do I have to declare a second CUSTOMVERTEX object and then make a second render function just for the second triangle. This sounds a little extensive. Is there a shorter way? Sample code would be nice;)

wien
May 9th, 2004, 10:46 AM
No you don't have to do that. :)

It's been a while since I used Direct3D so I might be somewhat off, but at some point you setup a vertex-array right? Right now it probably contains 3 CUSTOMVERTEX objects. What you do is simpy add 3 more vertices to this array (the next triangle's vertices), and draw the same way you do now. Nothing magic.

Also remember to pass the correct "number of vertices" to D3D.