Does anyone have a cooridnate display mesh? 
Author Message
 Does anyone have a cooridnate display mesh?

I'm looking for a simple mesh (.X) file of a coordinate display
(X,Y,Z) for a Left Hand system (Y up, X right, Z into the screen).  I
want to put this into the lower LH corner of my DX9 display port so
the user can always tell the current orientation of the part they are
viewing. I have no 3D software to create this so I would have to
create progmatically and save it off myself.  I'd rather not if
someone in this group has one already,  or knows where I can get one.

Thank you and Sincerely,

Kevin



Mon, 19 Sep 2005 23:42:27 GMT  
 Does anyone have a cooridnate display mesh?
In what format? and size
Im using 3D-Studio, does that help you?

Quote:
>-----Original Message-----
>I'm looking for a simple mesh (.X) file of a coordinate
display
>(X,Y,Z) for a Left Hand system (Y up, X right, Z into the
screen).  I
>want to put this into the lower LH corner of my DX9
display port so
>the user can always tell the current orientation of the
part they are
>viewing. I have no 3D software to create this so I would
have to
>create progmatically and save it off myself.  I'd rather
not if
>someone in this group has one already,  or knows where I
can get one.

>Thank you and Sincerely,

>Kevin
>.



Tue, 20 Sep 2005 16:03:04 GMT  
 Does anyone have a cooridnate display mesh?
Thank you for replying!  How about a *.X microsoft binary mesh file
that is < 100KB?  If this is a hassle for you then please don't
bother, I don't want to be a nusance. . ..

If not a problem then thank you in advance!

Sincerely,

Kevin C

Quote:

> In what format? and size
> Im using 3D-Studio, does that help you?

> >-----Original Message-----
> >I'm looking for a simple mesh (.X) file of a coordinate
>  display
> >(X,Y,Z) for a Left Hand system (Y up, X right, Z into the
>  screen).  I
> >want to put this into the lower LH corner of my DX9
>  display port so
> >the user can always tell the current orientation of the
>  part they are
> >viewing. I have no 3D software to create this so I would
>  have to
> >create progmatically and save it off myself.  I'd rather
>  not if
> >someone in this group has one already,  or knows where I
>  can get one.

> >Thank you and Sincerely,

> >Kevin
> >.



Wed, 21 Sep 2005 02:43:22 GMT  
 Does anyone have a cooridnate display mesh?
There's a 3D drawing program called Milkshape, that can export files
in a .X formt. I use it all the time. Search for it.It might be
shareware, maybe $20 as I recall.

Quote:
>I'm looking for a simple mesh (.X) file of a coordinate display
>(X,Y,Z) for a Left Hand system (Y up, X right, Z into the screen).  I
>want to put this into the lower LH corner of my DX9 display port so
>the user can always tell the current orientation of the part they are
>viewing. I have no 3D software to create this so I would have to
>create progmatically and save it off myself.  I'd rather not if
>someone in this group has one already,  or knows where I can get one.

>Thank you and Sincerely,

>Kevin



Fri, 23 Sep 2005 19:47:57 GMT  
 Does anyone have a cooridnate display mesh?
Thank you for the reply!  That sounds useful,  I will check into it.
In the meantime I went ahead and progmatically created one.  It wasn't
too difficult as I simply created a cone with the cylinder mesh, and a
stem with the cylinder mesh and then added all the vertices and index
buffers to a new mesh called "ArrowMesh".  I simply rotate these about
the X and Y axis at the origin and translate them to a position in the
lower left corner in front (closer to the user) of any other
rendering.  Took me a while to figure out how to do all of that (I'm
new to DX in general, I'm starting off in DX9). I also changed the
default mesh type to positionColored so each arrow can simply have its
own color.  I'll include the code here for anyone that wants it.  Now
that I've got the code,  it's a simple thing to save off the mesh file
if I want,  Or simply recreate the coordinate display on demand.

I'll check into "MilkShape".

Thank you and sincerely,

Kevin

  Private Function CreateArrowMesh(ByVal Dev As Direct3D.Device, ByVal
ArrowHeadColor As Drawing.Color) As Direct3D.Mesh

'mArrowMesh = Direct3D.Mesh.FromFile("E:\KevTemp\CoordinateMesh.X", 0,
Dev)
'Return
    Dim ArrowMesh As Direct3D.Mesh

    Try
      'Create the ConeMesh
      Dim TempConeMesh As Direct3D.Mesh = Direct3D.Mesh.Cylinder(Dev,
1.0F, 10.0F, 26.0F, 10, 10)
      Dim ConeMesh As Direct3D.Mesh
      ConeMesh = TempConeMesh.Clone(0,
Direct3D.CustomVertex.PositionColored.Format, Dev)
      TempConeMesh.Dispose()
      TempConeMesh = Nothing

      'Create the Stem Mesh
      Dim TempStem As Direct3D.Mesh = Direct3D.Mesh.Cylinder(Dev,
5.0F, 5.0F, 30.0F, 10, 10)
      Dim StemMesh As Direct3D.Mesh
      StemMesh = TempStem.Clone(0,
Direct3D.CustomVertex.PositionColored.Format, Dev)
      TempStem.Dispose()
      TempStem = Nothing

      ArrowMesh = New Direct3D.Mesh(StemMesh.NumberFaces +
ConeMesh.NumberFaces, StemMesh.NumberVertices +
ConeMesh.NumberVertices, 0,
Direct3D.CustomVertex.PositionColored.Format, Dev)
      Try
        Dim StemVerts(), ConeVerts(), ArrowVerts() As
Direct3D.CustomVertex.PositionColored
        ConeVerts = CType(ConeMesh.LockVertexBuffer(GetType(Direct3D.CustomVertex.PositionColored),
0, ConeMesh.NumberVertices), Direct3D.CustomVertex.PositionColored())
' Lock the buffer (which will return our structs)
        StemVerts = CType(StemMesh.LockVertexBuffer(GetType(Direct3D.CustomVertex.PositionColored),
0, StemMesh.NumberVertices), Direct3D.CustomVertex.PositionColored())
' Lock the buffer (which will return our structs)
        ArrowVerts =
CType(ArrowMesh.LockVertexBuffer(GetType(Direct3D.CustomVertex.PositionColored),
0, ArrowMesh.NumberVertices), Direct3D.CustomVertex.PositionColored())
' Lock the buffer (which will return our structs)
        Dim i As Integer
        Dim Counter As Integer = 0

        For i = 0 To StemVerts.Length - 1
          ArrowVerts(Counter).SetPosition(New Vector3(StemVerts(i).X,
StemVerts(i).Y, StemVerts(i).Z - 15.0F))
          ArrowVerts(Counter).Color = Drawing.Color.BurlyWood.ToArgb
          Counter += 1
        Next i

        For i = 0 To ConeVerts.Length - 1
          ArrowVerts(Counter).SetPosition(New Vector3(ConeVerts(i).X,
ConeVerts(i).Y, ConeVerts(i).Z - 42.0F))
          ArrowVerts(Counter).Color = ArrowHeadColor.ToArgb
          Counter += 1
        Next i

      Try
        Dim StemIB() As Short
        Dim ConeIB() As Short
        Dim ArrowIB() As Short
        StemIB = CType(StemMesh.LockIndexBuffer(GetType(Short), 0,
StemMesh.NumberFaces * 3), Short())
        ConeIB = CType(ConeMesh.LockIndexBuffer(GetType(Short), 0,
ConeMesh.NumberFaces * 3), Short())
        ArrowIB = CType(ArrowMesh.LockIndexBuffer(GetType(Short), 0,
ArrowMesh.NumberFaces * 3), Short())
        Counter = 0
        For i = 0 To StemIB.Length - 1
          ArrowIB(Counter) = StemIB(i)
          Counter += 1
        Next i
        For i = 0 To ConeIB.Length - 1
          ArrowIB(Counter) = CShort(ConeIB(i) +
StemMesh.NumberVertices)
          Counter += 1
        Next i
      Catch Exc As System.Exception
        Throw exc
      Finally
        Try : StemMesh.UnlockIndexBuffer() : Catch : End Try
        Try : ConeMesh.UnlockIndexBuffer() : Catch : End Try
        Try : ArrowMesh.UnlockIndexBuffer() : Catch : End Try
      End Try

      Catch Exc As Exception
        Throw Exc
      Finally
        Try : ConeMesh.UnlockVertexBuffer() : Catch : End Try
        Try : StemMesh.UnlockVertexBuffer() : Catch : End Try
        Try : ArrowMesh.UnlockVertexBuffer() : Catch : End Try
      End Try

      'Clean up
      ConeMesh.Dispose()
      ConeMesh = Nothing

      StemMesh.Dispose()
      StemMesh = Nothing

      'Code for saving the mesh to disk
      'Dim pdwAdjacency((3 * mArrowMesh.NumberFaces) - 1) As Integer
      'mArrowMesh.GenerateAdjacency(0.0F, pdwAdjacency)
      'mArrowMesh.Save("C:\Temp\CoordinateMesh.X", pdwAdjacency, New
Direct3D.ExtendedMaterial() {New Direct3D.ExtendedMaterial()},
Direct3D.XFileFormat.Binary)

      Return (ArrowMesh)
    Catch Exc As Exception
      ArrowMesh = Nothing
    End Try
  End Function

Quote:

> There's a 3D drawing program called Milkshape, that can export files
> in a .X formt. I use it all the time. Search for it.It might be
> shareware, maybe $20 as I recall.

> >I'm looking for a simple mesh (.X) file of a coordinate display
> >(X,Y,Z) for a Left Hand system (Y up, X right, Z into the screen).  I
> >want to put this into the lower LH corner of my DX9 display port so
> >the user can always tell the current orientation of the part they are
> >viewing. I have no 3D software to create this so I would have to
> >create progmatically and save it off myself.  I'd rather not if
> >someone in this group has one already,  or knows where I can get one.

> >Thank you and Sincerely,

> >Kevin



Sun, 25 Sep 2005 00:40:23 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Mesh Names or Mesh Subset Names

2. Mesh Picking, Boned Animation, Faked Meshes

3. Progressive meshes / Simplifying meshes

4. Is anyone interested in having those new nifty toolbars

5. Is anyone interested in having those new nifty toolbars

6. anyone else having this problem?

7. Is Anyone Having Problems With The Toolbar Control?

8. Anyone having problems masking bitmaps in UserControls?

9. Anyone having WebControl size problems like this?

10. Anyone having problems with OpenUrl and IIS 4.0

11. Anyone having problems with .recordcount?

12. Anyone having success with VB Srv Pak 1?

 

 
Powered by phpBB® Forum Software