Hey,
I choose JSON for my example because it is human readable and "Code for parsing and generating JSON data is readily available in many programming languages." (wikipedia)
But it was not my goal to suggest JSON. I would like to see the (a) library expandable to vertex colors, normals, uv-maps, etc.
Again, just some thoughts.
Rolf
Steffen Wrote:this is a perfect example for how much more compact our current syntax is over JSON.Yes, you are right. I could have also used xml (even worse) in my example or something like:
Code:
// comment
v 30 24 20 c 16 n 1 0 0 uv 1 0 // and so on...
v 26 24 16 c 16
v -26 24 16 c 16
v -30 24 20 c 16
v -26 24 -16 c 16
v -30 24 -20 c 16
v 26 24 -16 c 16
v 30 24 -20 c 16
v 30 0 20 c 24
v -30 0 20 c 24
v -30 0 -20 c 24
v 30 0 -20 c 24
v 30 24 20 c 24
v -30 24 20 c 24
v -30 24 -20 c 24
v 30 24 -20 c 24
v -30 0 -20 c 16
v 30 0 -20 c 16
v 30 0 20 c 16
v -30 0 20 c 16
r 10 4 0 1 0 0 0 -5 0 0 0 1 stud4.dat
r -10 4 0 1 0 0 0 -5 0 0 0 1 stud4.dat
r 0 24 0 26 0 0 0 -20 0 0 0 16 box5.dat invert
q 0 1 2 3
q 3 2 4 5
q 5 4 6 7
q 7 6 1 0
l 8 9
l 9 10
l 10 11
l 11 8
l 12 13
l 13 14
l 14 15
l 15 12
l 12 8
l 13 9
l 15 11
l 14 10
q 16 17 18 19
q 18 0 3 19
q 19 3 5 16
q 17 7 0 18
r 20 0 10 1 0 0 0 1 0 0 0 1 stud.dat
r 0 0 10 1 0 0 0 1 0 0 0 1 stud.dat
r -20 0 10 1 0 0 0 1 0 0 0 1 stud.dat
r 20 0 -10 1 0 0 0 1 0 0 0 1 stud.dat
r 0 0 -10 1 0 0 0 1 0 0 0 1 stud.dat
r -20 0 -10 1 0 0 0 1 0 0 0 1 stud.dat
But it was not my goal to suggest JSON. I would like to see the (a) library expandable to vertex colors, normals, uv-maps, etc.
Roland Melkert Wrote:I agree JSON is pretty useless for just replacing the current (offiicial) .dat's.You are right. I should have added some normals and other stuff to the example (e.g.):
But when you start flattening things JSON will be the better format as it allows for grouping / indexing the vertices so normals and texture info starts to make more sense.
Code:
"Vertices": [
{
"Position": [30, 24, 20],
"Normal": [0, 1, 0],
"Color": 16
},
{
"Position": [26, 24, 16],
"Normal": [0, 1, 0],
"Color": 16
},
}
[...]
"Meshes": [
{
"Name": "Inside"
"HideCondition": {
"And": [
"Ref": {
"Position": [20, 24, 10],
"Orientation": [1, 0, 0, 0, 1, 0, 0, 0, 1],
"File": "nstud.dat"
},
"Ref": {
"Position": [0, 24, 10],
"Orientation": [1, 0, 0, 0, 1, 0, 0, 0, 1],
"File": "nstud.dat"
},
"Ref": {
"Position": [-20, 24, 10],
"Orientation": [1, 0, 0, 0, 1, 0, 0, 0, 1],
"File": "nstud.dat"
},
"Ref": {
"Position": [20, 24, -10],
"Orientation": [1, 0, 0, 0, 1, 0, 0, 0, 1],
"File": "nstud.dat"
},
"Ref": {
"Position": [0, 24, -10],
"Orientation": [1, 0, 0, 0, 1, 0, 0, 0, 1],
"File": "nstud.dat"
},
"Ref": {
"Position": [-20, 24, -10],
"Orientation": [1, 0, 0, 0, 1, 0, 0, 0, 1],
"File": "nstud.dat"
}
]
}
"Ref": {
"Position": [10, 4, 0],
"Orientation": [1, 0, 0, 0, -5, 0, 0, 0, 1],
"File": "stud4.dat"
},
"Ref": {
"Position": [-10, 4, 0],
"Orientation": [1, 0, 0, 0, -5, 0, 0, 0, 1],
"File": "stud4.dat"
},
"Ref": {
"Position": [0, 24, 0],
"Orientation": [26, 0, 0, 0, -20, 0, 0, 0, 16],
"File": "box5.dat"
"BFC": "Invert"
}
},
{
"Name": "Outside",
[...]
}
Again, just some thoughts.
Rolf