Author Topic: DDA - ascii 3D object file format  (Read 4386 times)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10638
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
DDA - ascii 3D object file format
« on: 2009-Dec-07 »
Code: GLBasic [Select]
DDDA 1.1 # DDDA version_number
# file must start with "DDDA"

# texture coordinates
4            # texture coordinates count
0.000 0.000  # uv of vertex 0
0.000 0.000  # uv of vertex 1
0.000 0.000  # uv 2
0.000 0.000  # uv 3

# faces
2            # number of faces
255 255 255  # material color for face 1 (R G B)
3  0 0 3 0 2 0# number_of_nodes (3=triangle) n1 t1 n2 t2 ni ti ... (n=position index, t=texture index)
255 255 255  # RGB for face 2
3  0 2 1     # n.o.n. n1 t1 n2 t2 ...

# animation frames
2            # number of keyframes for this model
4            # nof_vertices_for_keyframe 1
0.0 1.8  0.6   0 1 0 # x1 y1 z1 nx ny nz ( 3 position, 3 normal )
2.0 1.5  0.9   0 1 0 # x2 y2 z2 nx ny nz
1.9 0.1 -0.2   0 1 0
0.0 0.1 -0.3   0 1 0
4            # nof_vertices_for_keyframe 2
0.0 1.9 0.0   0 1 0
2.0 1.9 0.0   0 0 1
1.9 0.0 0.1   0 0 1
0.0 0.0 0.0   0 1 0
 

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1577
  • Particle Hawk
    • View Profile
    • Silver Volumetric Software
Re: DDA - ascii 3D object file format
« Reply #1 on: 2009-Dec-07 »
Thanks  :nw:
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

http://silver.binhoster.com/

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4948
  • O Rly?
    • View Profile
Re: DDA - ascii 3D object file format
« Reply #2 on: 2009-Dec-08 »
whats about the textures?
the loader load it by itself?
Multitextures / More then 1 texture per object?


hmm... another keyframe format...  :x
Bones would be better  ;)
« Last Edit: 2009-Dec-08 by Schranz0r »
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2600Mhz Ram, HIS 7970 GHz Edition @3GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1577
  • Particle Hawk
    • View Profile
    • Silver Volumetric Software
Re: DDA - ascii 3D object file format
« Reply #3 on: 2009-Dec-08 »
Gernot,

I am testing anim9or export feature...
It has alot of outputs to sort out...

And a simple cube with 6 faces, 8 points, and 8 texture coordinates, has 30 normals....
This is a problem because your dda format has only one xyz for a normal on each point:

# animation frames
2            # number of keyframes for this model
4            # nof_vertices_for_keyframe 1
0.0 1.8  0.6   0 1 0 # x1 y1 z1 nx ny nz ( 3 position, 3 normal )
2.0 1.5  0.9   0 1 0 # x2 y2 z2 nx ny nz
1.9 0.1 -0.2   0 1 0
0.0 0.1 -0.3   0 1 0

This is where im at...im almost done and stuck here,
 because i dont know how to determine which normals i need to export.
« Last Edit: 2009-Dec-08 by Hemlos »
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

http://silver.binhoster.com/

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1577
  • Particle Hawk
    • View Profile
    • Silver Volumetric Software
Re: DDA - ascii 3D object file format
« Reply #4 on: 2009-Dec-08 »
I finished the first object export plugin, for anim8or v0.97d.
It only makes one frame.
Screenshot is the converted object, loaded in the 3d object analyzer...looks like the normals are correct.
I will try to do the multiple keyframes another time.


Put the plugin script with anim8or.exe /SCRIPTS subdirectory,
 and set the configuration in anim8or to point to the proper SCRIPT directory.
Anim8or will open a debug console when a plugin is loaded, this is normal.


« Last Edit: 2009-Dec-08 by Hemlos »
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

http://silver.binhoster.com/

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10638
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: DDA - ascii 3D object file format
« Reply #5 on: 2009-Dec-09 »
If you need more normals per vertex, just add a new vertex with the same x,y,z position and different nx,ny,nz directions.

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1577
  • Particle Hawk
    • View Profile
    • Silver Volumetric Software
Re: DDA - ascii 3D object file format
« Reply #6 on: 2009-Dec-09 »
Unfortunetly i found with more testing, the texture coordinates get messed up in larger objects.....this plugin i wrote doesnt work properly.
Also, anim8or will not do multiple objects for keyframes, so exporting.3ds will have to do for now.
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

http://silver.binhoster.com/