Create mesh DX9 question, Lighting.VB example 
Author Message
 Create mesh DX9 question, Lighting.VB example

I've been working on an application to display lumber in a DX9
viewport with live (real-time)scanned geometric data.  I've had great
success by creating multiple VertexBuffers per surface, and displaying
these by drawing their primitives as triangleStrips and then wrapping
these images with an actual picture of the board that was taken in
conjunction with the geo scans.

I'm exploring the possiblity of creating and working with meshes
instead of VB's.  I'm not sure why I want to do this (as I am new to
DX-X) other than 1.) most of the VB examples in the DX9 browser work
with meshes. 2.) Meshes can be optimized (I like the sounds of that!)
and 3.)  I see that meshes can be saved, this is very appealing as it
would allow the user to save a particular board of interest off to a
directory to be viewed later.  This would work well for us as a
company to debug our equipment, and the mesh ".X" file is easily read
back into a DX9 application.

The system produces a large amount of data, with a new system coming
out that will produce 4 times the data I'm currently working with.

In going through the lighting.vb example I see that the author fills
out the VB (all 3 points of every triangle) and then indexes them.  If
I were to follow this logic it raises the following questions:

1 - the meshIndex is an array of shorts, the maximum value being
32767.  This means that the mesh is limited to (32767-1)/3 triangles,
or 10922 triangles per mesh.  For 1, 4" surface of an 8' 2X4, I'll get
roughly 204,000 triangle primitives.  This equates to roughly 20
meshes for a top or bottom surface. Assuming 8 meshes per side (again
of an 8', 2X4 board) we're up to a total of 56 meshes for a short 2X4.
 Of course the number goes up with an increase in any board dimension.

What are my gains by doing this?
Is it possible to save these 56 meshes for a single board to a single
".X" file?
(I see that the mesh.save is overloaded 8 different ways! but can't
see how to do this. . .)  Is it possible to somehow save these meshes
into a single, cohesive geometry, and then save?

Thank You and Sincerely,

Kevin



Mon, 12 Sep 2005 05:00:22 GMT  
 Create mesh DX9 question, Lighting.VB example
I'm posting to my own question since over time (and no response from
others) I've answered some of these questions.  I know it's useful for
others that are doing a subject search in this group for similar
information.

I've converted my lumber geometry from vertex buffers to mesh files.
I'm using as many as I expected with no adverse affects.  The frame
rates are slightly faster using the meshes, probably because they are
optimized and have no redundant(or fewer at least) vertices to render.
 The vertex buffers were faster to create ( I wait longer to create
the meshes) maybe because I had optimized the vertex buffer creation
code, and there may be more internal overhead in creating ones own
meshes.

Creating your own meshes is hard at first, but not bad once you
understand it. It does give one a greater appreciation for what is
going on in the mesh object.

For an example of how to create your own mesh, look at the lighting.vb
example in the DirectX9 SDK sample code, or search for "Does anyone
have a cooridnate display mesh?" in this user group as I've posted an
example to get you started there.

-Sincerely,

Kevin

Quote:

> I've been working on an application to display lumber in a DX9
> viewport with live (real-time)scanned geometric data.  I've had great
> success by creating multiple VertexBuffers per surface, and displaying
> these by drawing their primitives as triangleStrips and then wrapping
> these images with an actual picture of the board that was taken in
> conjunction with the geo scans.

> I'm exploring the possiblity of creating and working with meshes
> instead of VB's.  I'm not sure why I want to do this (as I am new to
> DX-X) other than 1.) most of the VB examples in the DX9 browser work
> with meshes. 2.) Meshes can be optimized (I like the sounds of that!)
> and 3.)  I see that meshes can be saved, this is very appealing as it
> would allow the user to save a particular board of interest off to a
> directory to be viewed later.  This would work well for us as a
> company to debug our equipment, and the mesh ".X" file is easily read
> back into a DX9 application.

> The system produces a large amount of data, with a new system coming
> out that will produce 4 times the data I'm currently working with.

> In going through the lighting.vb example I see that the author fills
> out the VB (all 3 points of every triangle) and then indexes them.  If
> I were to follow this logic it raises the following questions:

> 1 - the meshIndex is an array of shorts, the maximum value being
> 32767.  This means that the mesh is limited to (32767-1)/3 triangles,
> or 10922 triangles per mesh.  For 1, 4" surface of an 8' 2X4, I'll get
> roughly 204,000 triangle primitives.  This equates to roughly 20
> meshes for a top or bottom surface. Assuming 8 meshes per side (again
> of an 8', 2X4 board) we're up to a total of 56 meshes for a short 2X4.
>  Of course the number goes up with an increase in any board dimension.

> What are my gains by doing this?
> Is it possible to save these 56 meshes for a single board to a single
> ".X" file?
> (I see that the mesh.save is overloaded 8 different ways! but can't
> see how to do this. . .)  Is it possible to somehow save these meshes
> into a single, cohesive geometry, and then save?

> Thank You and Sincerely,

> Kevin



Sun, 25 Sep 2005 00:59:53 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Creating a mesh (DX9, VB.NET)

2. DX9: 'Use32bit' on Mesh creation causes rendering failure. Lighting.VB example

3. Error in DX9 VB Mesh Sample

4. C++ vs VB with Skinned Mesh examples

5. Skinned Mesh Example?

6. Mesh Names or Mesh Subset Names

7. Mesh Picking, Boned Animation, Faked Meshes

8. Progressive meshes / Simplifying meshes

9. Multiple light sources with ambient lighting.

10. dx9.0a install problem, and question

11. Creating 3D meshes

12. question about directinput and dx9

 

 
Powered by phpBB® Forum Software