ORGE 3D MESH FORMAT ?

Advanced game related topics
TIGER
User
User
Posts: 81
Joined: Mon Feb 23, 2004 8:33 pm

ORGE 3D MESH FORMAT ?

Post by TIGER »

Does anyone here knows how to create this format.

If its not . Im thinking about creating a utility which will
convert 3DS and X files into my own 3D format which wiil be easily loaded
in PB .

What do you goys think . Is there is a point to do that ?
PIII450 128RAM TNT2
User avatar
J. Baker
Addict
Addict
Posts: 2196
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Post by J. Baker »

www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

danilo has written a milkshape importer, grab it here
SPAMINATOR NR.1
pg
User
User
Posts: 75
Joined: Wed Jun 18, 2003 3:31 pm
Location: Swiss
Contact:

Post by pg »

This is an importer for the ascii x format:

http://www.mypage.bluewin.ch/bithandler ... porter.zip
DarkDragon
Addict
Addict
Posts: 2348
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

uhm I created my own mesh format here: viewtopic.php?t=10998
bye,
Daniel
MadMax
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Oct 06, 2003 11:56 am

Post by MadMax »

Is the *.mesh format a secret? :?
DarkDragon
Addict
Addict
Posts: 2348
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

A secret? No:

uhm here is a saving procedure:

Code: Select all

Structure Tri3D
  Vert.f[3]
  U.f[3]
  V.f[3]
EndStructure

Structure Point3D
  X.f
  Y.f
  Z.f
EndStructure

Procedure.f GetVertexX(Vert)
  SelectElement(Vert(), Vert)
  ProcedureReturn Vert()\X
EndProcedure
Procedure.f GetVertexY(Vert)
  SelectElement(Vert(), Vert)
  ProcedureReturn Vert()\Y
EndProcedure
Procedure.f GetVertexZ(Vert)
  SelectElement(Vert(), Vert)
  ProcedureReturn Vert()\Z
EndProcedure
Procedure SaveZM(ID, Filename.s)
  If CreateFile(ID, Filename.s)
    ForEach Tri()
      WriteFloat(Tri()\U[0])
      WriteFloat(Tri()\V[0])
      WriteFloat(GetVertexX(Tri()\Vert[0]))
      WriteFloat(GetVertexY(Tri()\Vert[0]))
      WriteFloat(GetVertexZ(Tri()\Vert[0]))
      WriteFloat(Tri()\U[1])
      WriteFloat(Tri()\V[1])
      WriteFloat(GetVertexX(Tri()\Vert[1]))
      WriteFloat(GetVertexY(Tri()\Vert[1]))
      WriteFloat(GetVertexZ(Tri()\Vert[1]))
      WriteFloat(Tri()\U[2])
      WriteFloat(Tri()\V[2])
      WriteFloat(GetVertexX(Tri()\Vert[2]))
      WriteFloat(GetVertexY(Tri()\Vert[2]))
      WriteFloat(GetVertexZ(Tri()\Vert[2]))
    Next
    CloseFile(ID)
  EndIf
EndProcedure
Well, you see it consists in floats.

U, V = Texturecoords:
UVert1
VVert1
XVert1
YVert1
ZVert1
UVert2
VVert2
XVert2
YVert2
ZVert2
UVert3
VVert3
XVert3
YVert3
ZVert3
bye,
Daniel
Post Reply