Jump to content
  • Advertisement
Sign in to follow this  
Zmax

Meshes

This topic is 4826 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 wanted to create a mesh from the code...and to put my vertexBuffer,IndexBuffer inside in order to create the normals for the each vertex in my buffer.(using the computeNormals of the mesh) I don't know what's wrong here but i get an overflow error,..

        Dim auxMesh As Mesh = Nothing
        auxMesh = New Mesh(HeightMapCls.BmpWidth * HeightMapCls.BmpHeight / 3, HeightMapCls.BmpWidth * HeightMapCls.BmpHeight, MeshFlags.SystemMemory, MyVertexType.Format, device)

        auxMesh.VertexBuffer.SetData(HeightMapCls.verts, 0, 0)
        auxMesh.IndexBuffer.SetData(HeightMapCls.indexArray, 0, 0)

        auxMesh.ComputeNormals()

        VertexCls.vertexBuffer = auxMesh.VertexBuffer
        VertexCls.indexBuffer = auxMesh.IndexBuffer


        device.SetStreamSource(0, VertexCls.vertexBuffer, 0)
        device.Indices = VertexCls.indexBuffer

The...number of faces parameter should be: vertexNR/3 no?,..hmmm what could be?

Share this post


Link to post
Share on other sites
Advertisement
You should probably take a look at the MeshFromOBJ sample that comes with the SDK. That sample shows how to initialize an ID3DXMesh object with data gathered from any source. The mesh specifically gathers the data from a Wavefront Object file (.obj) but all you need to look at is how they create and initialize the mesh once they have the data available.

neneboricua

Share this post


Link to post
Share on other sites
What skd? i don't have that sample in my dx9 sdk...hmm can you pls give me a link or something?

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!