Co2 Posted June 8, 2003 Posted June 8, 2003 Hello, Direct3D Tutorial 2 for VB.Net from DirectX9 SDK (%DXSDK%\Samples\VB.Net\DirectX3D\Tutorials\Tutorial2) teachs how to render vertices on screen. This tutorial render a triangle on screen. I want to render a rectangle instead of the triangle in that tutorial. I tried to add a vertice to the vertexbuffer but it doesn't work. I seem to misunderstand the vertices/vertexbuffer concepts. I know this is somewhat easy, but I haven't been able to do it. Do you have any clues on this ? Thanks. Quote
AndreRyan Posted June 8, 2003 Posted June 8, 2003 Everything in Direct3D consists of Triangles, You probably need to add 3 vertices to the VertexBuffer and Draw it using DrawPrimitive with the TraingleList Flag Quote .Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
Co2 Posted June 8, 2003 Author Posted June 8, 2003 I tried that too, and still cannot see it one screen. Quote
Defiant00 Posted June 9, 2003 Posted June 9, 2003 Rendering a rectangle... Oddly enough, I went through those within the last day or two myself, but I got mine to do a rectangle (which makes this whole topic seem rather odd). Easiest way is to just add your fourth point to the VertexBuffer and then when rendering use DrawPrimitive.TriangleFan and I believe the last argument of that render call (can't think of what the function is called that you use to render right now) but the last argument is how many elements to render, so you just need to change it from 1 to 2. It worked for me, if you still have questions just post again and I'll try and find the exact code that I was using, but hopefully that'll work for you. -Defiant00 Quote
ThePentiumGuy Posted June 17, 2003 Posted June 17, 2003 http://www.directX4vb.com Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.