Jump to content
  • Advertisement
Sign in to follow this  
vidalsasoon

DX(.NET 2.0) - Getting VertexBuffer positions from a mesh

This topic is 4603 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I could get the VertexBuffer positions with .NET 1.0... /* .NET 1.0 PositionNormalTextured[] lockedVerts = mesh.LockVertexBuffer( typeof(PositionNormalTextured), LockFlags.None, mesh.NumberVertices) as PositionNormalTextured[]; */ Using .NET 2.0, "LockVertexBuffer(...)" only returns a GraphicsBuffer so i'm now a little lost on what to do. // this compiles but how to get the positions of my vertices? graphicsBuffer = mesh.LockVertexBuffer<PositionNormalTextured>(LockFlags.None); My experience with Generics is limited to a few hours... I assume somehow getting the data from the "graphicsBuffer" will give data of type "PositionNormalTextured"?

Share this post


Link to post
Share on other sites
Advertisement
I just had a look in the MDX documentation (still a painful experience I find).

this page (on Vertex Buffers) has a code fragment at the bottom seems to indicate a couple of ways of getting at the data.

In general, the GraphicsStream.InternalData property seems to be what you need to look into.

hth
Jack

Share this post


Link to post
Share on other sites
At a guess, your now using MDX for .NET 2 - right? If so, graphicsstream now uses generics for this (yay for less casts!)

Share this post


Link to post
Share on other sites
GraphicsBuffer.InternalData does not exist in .net 2.0

good alternatives look like:

GetBuffer
or
DataBuffer

Compiler doesn't like what i'm typing down... Next SDK comes out in a couple weeks weeks with hopefully a little documentation.


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!