|
-
Mar 22nd, 2000, 02:52 AM
#2
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|