Here's an example, a function I wrote to examine vertex information.
; Sample usage of DumpVertices.
Graphics3D 800,600,16,2
cone=CreateCone(5)
dumpvertices(cone,100,"Blitz primitive: Cone(5)")
Stop : End
Function DumpVertices( mesh, maxVertices, message$="Vertex list" )
Local nSurfs, sIndex, surface, vCount, lf$, txt$
Local x$,y$,z$, nx$,ny$,nz$
lf$=Chr$(10)
nSurfs=CountSurfaces( mesh )
DebugLog lf+message+lf
DebugLog "Number of surfaces = "+nSurfs
For sIndex=1 To nSurfs
DebugLog lf + lf
DebugLog "Surface = "+sIndex+lf
surface=GetSurface( mesh, sIndex )
For v=0 To CountVertices( surface ) - 1
vCount = vCount + 1
If vCount > maxVertices
DebugLog lf+"Number of vertices shown = "+(vCount-1)
Return
End If
x = RSet( VertexX( surface, v ), 13)
y = RSet( VertexY( surface, v ), 13)
z = RSet( VertexZ( surface, v ), 13)
nx = RSet( VertexNX( surface, v ), 13)
ny = RSet( VertexNY( surface, v ), 13)
nz = RSet( VertexNZ( surface, v ), 13)
txt="v="+RSet(v,4)+" "+x+y+z+" "+nx+ny+nz
DebugLog txt
Next
Next
DebugLog lf+"Number of vertices shown = "+vCount
End Function
I usually copy the DebugLog output and paste it into an empty window in the Blitz IDE.
The MaxVertices parameter is there so I can quickly examine some vertices without filling up the DebugLog with thousands of lines of output.
If you want all vertices just use a huge number like 999999.
|