Results 1 to 2 of 2

Thread: DX7 GAME QUESTION

  1. #1

    Thread Starter
    Addicted Member slashandburn's Avatar
    Join Date
    Aug 1999
    Location
    Marietta, Ga
    Posts
    229
    In some of the games I have made I ususlly Use BitBlt and make a 64X64 grid. But Now I want to take this same Idea of the grid But add more to it. My question is In Dirext x 7 for vb How could I generate a 64 X 64 Mesh that I know how to make the X,Y,Z locations to work. but how could I generate it?

  2. #2
    Junior Member
    Join Date
    Mar 2000
    Posts
    30
    This should help:

    Sub loadmap(file$)
    Dim title$, i%
    Dim mesh As Direct3DRMMeshBuilder
    Dim txt(4) As Direct3DRMTexture
    'load up the default textures
    For i% = 1 To 4
    D3DRM.LoadTexture App.Path & "\txt" & i% & ".bmp", txt(i%)
    Next

    block% = 0
    Open file$ For Input As #1
    Input #1, title$
    Do
    Input #1, btyp(block%), bx(block%), bz(block%), by(block%)

    'make a mesh and a frame to hold it
    D3DRM.CreateMeshBuilder mesh
    D3DRM.CreateFrame WorldFrame, bframe(block%)

    'now load the mesh as set the texture
    'the 256 is flags loadfromfile and instancebyreference
    mesh.Load App.Path & "\menbox" & btyp(block%) & ".x", 0, 256, 0, 0
    mesh.SetTexture txt(btyp(block%))

    'add the mesh to the frame, and scale it
    bframe(block%).AddVisual mesh
    bframe(block%).AddScale D3DRMCOMBINE_BEFORE, 3, 3, 3

    'scale positions
    bx(block%) = bx(block%) * 300
    by(block%) = by(block%) * 300 - 60
    bz(block%) = bz(block%) * 300 '+ 2000

    'position the frame based on the map
    bframe(block%).SetPosition WorldFrame, bx(block%), by(block%), bz(block%)
    Set mesh = Nothing

    block% = block% + 1
    Loop Until EOF(1)
    Close
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width