|
Post by botbuilder on Jun 23, 2004 4:23:27 GMT
A small program that converts .b3d, .3ds, and .x files to .bin files ready for loading into tokamak. It requires that it is in the same directory as the program "adjacency", included with tokamak 1.2 (in the tools directory). To use, put all the 3d files you want to convert into the same directory as the program. Hit run and it'll zip through them.
Graphics3D 640,480,32,2
dir=ReadDir(CurrentDir())
Repeat file$=Lower$(NextFile$(Dir))
If file$="" Then Exit
If FileType(file$) = 1 Then r4$=Right$(file$,4) If r4$=".3ds" Or r4$=".b3d" Or Right$(file$,2)=".x" Then Print "Converting "+file$ m=LoadMesh(file$) vcount=0 For s=1 To CountSurfaces(m) surf=GetSurface(m,s) For i=0 To CountVertices(surf)-1 vcount=vcount+1 Next Next If vcount>255 Then Print " *Can't process because there are more than 255 vertices" Else If r4$=".3ds" Or r4$=".b3d" Then file$=Left$(file$,Len(file$)-3) ElseIf Right$(file$,2)=".x" Then file$=Left$(file$,Len(file$)-1) fil=WriteFile(file$+"txt") WriteLine fil,vcount For s=1 To CountSurfaces(m) surf=GetSurface(m,s) For i=0 To CountVertices(surf)-1 WriteLine fil,VertexX(surf,i)+" "+VertexY(surf,i)+" "+VertexZ(surf,i) Next Next CloseFile fil ExecFile "adjacency "+file$+"txt "+file$+"bin" Delay 100 DeleteFile file$+"txt" EndIf EndIf End If Forever
CloseDir Dir
|
|
june
New Member
Posts: 13
|
Post by june on Jun 24, 2004 12:54:17 GMT
I have a problem. I have converted my .b3d file to .bin to importe in tokamak my convexe body and it says memory access violation at this line :
TOKRB_AddConvex(rb(i),Convex,BankSize(Convex))
This is in the sample in the wrapper version 0.6
|
|
|
Post by botbuilder on Jun 24, 2004 21:41:16 GMT
|
|
june
New Member
Posts: 13
|
Post by june on Jun 25, 2004 13:44:34 GMT
thanx
|
|