×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

ProcessVertices example anyone?

ProcessVertices example anyone?

ProcessVertices example anyone?

(OP)
I've got a set of 1-8 CustomVertex.PositionColored vertices that I am rendering as a point list.  Once I've rendered them, I need to label the points using transformed viewport coordinates and a call to DrawText.

Is there a way to get the transformed viewport coordinates of these vertices from directx w/o doing the math myself?

I assume that Device.ProcessVertices is the way to get the job done but I can't figure out how to make it work.  In DirectX 9 C#, I keep getting System.InvalidArgumentException.  I created the destBuffer with TransformedColored vertices.

Does anyone have a working example?

Thanks for any links or such!

RE: ProcessVertices example anyone?

I have also been looking for a good example. The difficult
part of ProcessVertices is setting up the vertex buffers
correctly. There is a complicated set of rules to get
the target buffer to match. It would be nice if there were
simply a function to get the necessary target FVF.

The only way I can find to get it right is to use the debug
driver for DirectX and tweak things based on the debug
messages. If rendering with a vertex shader, it seems even
more complex. I'm trying to get that working now, with no
success so far.

RE: ProcessVertices example anyone?

(OP)
In C#, I was trying to come up with a valid vertexDeclaration parameter having no idea what information it encapsulated.  In the end, if I remember right, the trick was to pass that parameter as null.

So what I did (since I don't use a mesh) was set the StreamSource (using an untransformed vertex buffer), VertexFormat, Texture, and Transform as though I was going to call DrawPrimitives.  Then I called ProcessVertices with a second vertex buffer that was to contain transformed coordinates.

Let me know if you keep having trouble, I've gotten it to work!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close