programmatic creation of meshes in Managed DX 9 / VB.Net

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: chris esposito (christopher.esposito_at_boeing.com)
Date: 07/01/04


Date: Thu, 01 Jul 2004 15:04:12 -0700

Greetings-
     I'm working on a VB.Net app that will dynamically generate 3D point
data sets (i.e., not from files) that I want to turn into Direct3D
meshes for display, triangle picking, and other manipulations. I have
VS.Net 2003 and the DX9 summer 2003 update installed.

 From what I can find, neither Tom Miller's (excellent) book nor the DX9
docs for managed languages discuss this in much depth, instead focusing
on either loading meshes from files or creating standard shapes via the
API.

Since a mesh contains both a vertex buffer and an index buffer, I'm
guessing that the steps to do what I want are:

        1) triangularize my data set via a 3D Delaunay triangulation, or
something similar (I'll be generating surface data, not volumetric, so
it seems to me that delaunay is a reasonable choice)

        2) generate and fill vertex and index buffers from the results of (1)
        3) call the Mesh constructor, passing in the number of faces
(triangles) and vertices, among other things

        4) call SetVertexBuffer and SetIndexBuffer to associate the index and
vertex buffers from (2) with the mesh from (3)

I know I've left out colors, lighting, materials, etc. As fas as getting
the mesh itself constructed, have I missed anything?

Thanks,
Chris



Relevant Pages

  • Animated skinned mesh bone boundings?
    ... bone so i guessed i needed to extract the verts from the skin for each bone ... //find out how many vertices were dealing with for the mesh ... //lock the mesh vertex buffer so we can copy vertex data into it ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: programmatic creation of meshes in Managed DX 9 / VB.Net
    ... 1)Delaunay triangulation ... 3)Lock the vertex buffer of the mesh, specify the vertex data, unlock the ... 4)Lock the index buffer of the mesh, specify the indices, unlock the index ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: De-lurking
    ... You can generate the base meshes fairly low-poly (ie less ... we use a great deal of various 'auto' ... Almost all auto 'meshers' still need ... manual tweaking with the resulting mesh. ...
    (rec.games.roguelike.development)
  • Vertex blending to vertex shader
    ... I tried to locate the previous message thread ... .I then convert this mesh into an FVF TYPE --- POSITION ... I Then fill the vertex buffer, from the Mesh object which is currently ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: Need advises for improving performance
    ... 40x32 tiles, and a mesh for each tile. ... too many meshes is causing the problem. ... Each mesh is loaded into a CD3DFrame, ... >> Im creating a simcity like game. ...
    (microsoft.public.win32.programmer.directx.graphics)