?
Solved

XNA 4.0 HLSL Drawing a Triangle

Posted on 2011-09-10
2
Medium Priority
?
598 Views
Last Modified: 2012-05-12
I came across an article that didn't go into much depth.  Is it possible for an Effect file to automatically draw a triangle, if I feed it a Vector3 location?

0
Comment
Question by:Iamtehbest
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 12

Expert Comment

by:satsumo
ID: 36523507
As far as I'm aware no current rendering architecture can create vertices in a shader.  To draw a triangle you need to give it three vertices.  The closest you coan get is using a point sprite with an image of triangle.

Strangely the PS2 could do this, and I suspect modern hardware works the same way.  It's the programming interfaces that get in the way.
0
 
LVL 12

Accepted Solution

by:
satsumo earned 2000 total points
ID: 36526797
Then again, maybe I was wrong.  This article describes a method of drawing multiple instances in Direct 3D, you may be able to use this method.  You still give it three vertices for a triangle, but the instance data could be a single point and the shader could change the output based on that point.

http://msdn.microsoft.com/en-us/library/bb173349(v=vs.85).aspx
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month14 days, 21 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question