I'm working on writting a model saver/loader for .asc models natively in DarkBasic, but I can't seem to get my head around this part.
(This is the part that troubles me most, finding out the face values)
Face list:
Face 0: A:3 B:1 C:0 AB:1 BC:1 CA:1
Material:"r255g255b255a0"
Smoothing: 1
Face 1: A:3 B:0 C:2 AB:1 BC:1 CA:1
Material:"r255g255b255a0"
Smoothing: 1
Face 2: A:1 B:3 C:2 AB:1 BC:1 CA:1
Material:"r255g255b255a0"
Smoothing: 1
Face 3: A:1 B:2 C:0 AB:1 BC:1 CA:1
Material:"r255g255b255a0"
Smoothing: 1
I'm currently using DymitryK's DKshop plug-in(freeware). It has the ability to return vertex positions, but I can't figure out how to return the face positions from this face list.
Here's an example working .asc file of a plane.
Quote: "Ambient light color: Red=0.3 Green=0.3 Blue=0.3
Named object: "Plane"
Tri-mesh, Vertices: 4 Faces: 4
Vertex list:
Vertex 0: X:-1.000000 Y:-1.000000 Z:0.000000
Vertex 1: X:-1.000000 Y:1.000000 Z:0.000000
Vertex 2: X:1.000000 Y:-1.000000 Z:0.000000
Vertex 3: X:1.000000 Y:1.000000 Z:0.000000
Face list:
Face 0: A:3 B:1 C:0 AB:1 BC:1 CA:1
Material:"r255g255b255a0"
Smoothing: 1
Face 1: A:3 B:0 C:2 AB:1 BC:1 CA:1
Material:"r255g255b255a0"
Smoothing: 1
Face 2: A:1 B:3 C:2 AB:1 BC:1 CA:1
Material:"r255g255b255a0"
Smoothing: 1
Face 3: A:1 B:2 C:0 AB:1 BC:1 CA:1
Material:"r255g255b255a0"
Smoothing: 1"
Here's my attempt at generating that same .asc model.
Note: I've highlighted parts that differ or are missing from the top to this one.
Quote: "Ambient light color: Red=0.3 Green=0.3 Blue=0.3
Named object: "Default"
Tri-mesh, Vertices: 4 Faces: 4
Vertex list:
Vertex 0: X:-1.000000 Y:0.000000 Z:1.000000
Vertex 1: X:-1.000000 Y:0.000000 Z:1.000000
Vertex 2: X:1.000000 Y:0.000000 Z:1.000000
Vertex 3: X:1.000000 Y:0.000000 Z:1.000000
Face list:
Face 0: A:0 B:0 C:0 AB:1 BC:1 CA:1
Material:"r255g255b255a0"
Smoothing: 1
Face 1: A:0 B:0 C:0 AB:1 BC:1 CA:1
Material:"r255g255b255a0"
Smoothing: 1
Face 2: A:0 B:0 C:0 AB:1 BC:1 CA:1
Material:"r255g255b255a0"
Smoothing: 1
Face 3: A:0 B:0 C:0 AB:1 BC:1 CA:1
Material:"r255g255b255a0"
Smoothing: 1"
I'm so close, any help would be truly appreciated. Once I get this done, I'll be that much closer to getting a .cob -> .dbo convertor done for us TS fans.
----------------------------------------------
Also, on a sidenote, does anyone know how to write quotes to a string? " "" " <- this doesn't seem to work.
So
write string 1,""Plane"" would appear as "Plane" in the file?
----------------------------------------------
Another sidenote
Can anyone link me to some more tutorials on model loading, or tutorials on finding face normals? What are the simplest 3D formats around?
http://astronomy.swin.edu.au/~pbourke/geomformats/
http://www.wotsit.org/search.asp?s=3d
----------------------------------------------
Again thanks for any help.
A book? I hate book. Book is stupid.
(Formerly known as Yellow)
