How do I draw a polygon?
To draw a polygon you have to create a vertex buffer. A vertex buffer is a Direct3D object used to store vertices. Vertices can be defined any way we want by defining a custom structure and a custom FVF (Flexible Vertex Format). Here is an example application "Triangle.zip" that uses vertices that are transformed (Vertices which are already in 2D window coordinates) and lit (meaning we are not using Direct3D lighting, but are supplying our own colors). After creating the VertexBuffer and writing data into it we have to- Set the Stream source as our vertex buffer
- Set our Custom FVF as the Vertex Shader
- Draw the Polygon(Here triangle) using DrawPrimitive call (To draw any complicated geometry first it is splitted into primitives like triangles or quads(Rectangular surfaces))
Sponsored links
Build IT Knowledge with Current & Trusted Content
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.
Check Out IT Certification Preparation Materials
Sign Up With SkillSoft & Get Access to Training Materials for Over 50 Professional Certifications.
Sign Up With SkillSoft & Get Access to Training Materials for Over 50 Professional Certifications.
Six Sigma Certification
100% Online-Six Sigma Certificate from Villanova - Find Out More Now.
100% Online-Six Sigma Certificate from Villanova - Find Out More Now.
SSH and SFTP support for .NET
Add complete SSH and SFTP support to your .NET framework application
Add complete SSH and SFTP support to your .NET framework application
3 Months Free - ASP.NET Web Hosting
3 Months Free & No Setup Fees on ASP.NET 3.5/2.0 Hosting on Windows 2008/2003 Servers ? Click Here!
3 Months Free & No Setup Fees on ASP.NET 3.5/2.0 Hosting on Windows 2008/2003 Servers ? Click Here!
