Introducing a second HL library?


Re: Introducing a second library?
#49
Hey Roland,

at first: sorry for the delay.

Roland Melkert Wrote:I too was thinking .obj, I just don't know if it allows for extension without confusing other software capable of importing 'clean' obj. Because it would be very nice to use standard .obj for the main mesh etc but still have the option to (at least) add conditional lines without breaking the format for other tools to use it as is.
As far as I found out, there is no possibility to extend the normal .obj-format. Indeed, that would have been a great solution.

Roland Melkert Wrote:Generating the basic .obj would actually be pretty basic as it's almost the same info/data you need to generate in order to draw the part efficiently in OpenGL.
Agreed.

I made a little experiment and created a JSON compatibe file that could be a basis for a further discussion. Here you can see the conversion of the file "s\3002s01.dat":

Code:
{
  "Header": {
    "Description": "~Brick  2 x  3 without Front Face",
    "Name": "s\3002s01.dat",
    "Author": "James Jessiman",
    "!LDRAW_ORG": "Subpart UPDATE 2003-03",
    "!LICENSE": "Redistributable under CCAL version 2.0 : see CAreadme.txt"
  },    
  "Metadata": {
    "BFC": "CCW"
  },
  "History": {
    "2002-05-07": "[unknown] BFC Certification"
    "2003-07-03": "[Steffen] Subfiled for patterns"
    "2003-12-19": "[PTadmin] Official Update 2003-03"
    "2007-08-29": "[PTadmin] Header formatted for Contributor Agreement"
    "2008-07-01": "[PTadmin] Official Update 2008-01"
  },
  "Vertices": [
    {
      "Position": [30, 24, 20],
      "Color": 16
    },
    {
      "Position": [26, 24, 16],
      "Color": 16
    },
    {
      "Position": [-26, 24, 16],
      "Color": 16
    },
    {
      "Position": [-30, 24, 20],
      "Color": 16
    },
    {
      "Position": [-26, 24, -16],
      "Color": 16
    },
    {
      "Position": [-30, 24, -20],
      "Color": 16
    },
    {
      "Position": [26, 24, -16],
      "Color": 16
    },
    {
      "Position": [30, 24, -20],
      "Color": 16
    },
    {
      "Position": [30, 0, 20],
      "Color": 24
    },
    {
      "Position": [-30, 0, 20],
      "Color": 24
    },
    {
      "Position": [-30, 0, -20],
      "Color": 24
    },
    {
      "Position": [30, 0, -20],
      "Color": 24
    },
    {
      "Position": [30, 24, 20],
      "Color": 24
    },
    {
      "Position": [-30, 24, 20],
      "Color": 24
    },
    {
      "Position": [-30, 24, -20],
      "Color": 24
    },
    {
      "Position": [30, 24, -20],
      "Color": 24
    },
    {
      "Position": [-30, 0, -20],
      "Color": 16
    },
    {
      "Position": [30, 0, -20],
      "Color": 16
    },
    {
      "Position": [30, 0, 20],
      "Color": 16
    },
    {
      "Position": [-30, 0, 20],
      "Color": 16
    }
  ],
  "Meshes": [
    {
      "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"
      },
      "Quad": {
        "Vertices": [0, 1, 2, 3]
      },
      "Quad": {
        "Vertices": [3, 2, 4, 5]
      },
      "Quad": {
        "Vertices": [5, 4, 6, 7]
      },
      "Quad": {
        "Vertices": [7, 6, 1, 0]
      },
      "Line": {
        "Vertices": [8, 9]
      },
      "Line": {
        "Vertices": [9, 10]
      },
      "Line": {
        "Vertices": [10, 11]
      },
      "Line": {
        "Vertices": [11, 8]
      },
      "Line": {
        "Vertices": [12, 13]
      },
      "Line": {
        "Vertices": [13, 14]
      },
      "Line": {
        "Vertices": [14, 15]
      },
      "Line": {
        "Vertices": [15, 12]
      },
      "Line": {
        "Vertices": [12, 8]
      },
      "Line": {
        "Vertices": [13, 9]
      },
      "Line": {
        "Vertices": [15, 11]
      },
      "Line": {
        "Vertices": [14, 10]
      },
      "Quad": {
        "Vertices": [16, 17, 18, 19]
      },
      "Quad": {
        "Vertices": [18, 0, 3, 19]
      },
      "Quad": {
        "Vertices": [19, 3, 5, 16]
      },
      "Quad": {
        "Vertices": [17, 7, 0, 18]
      },
      "Ref": {
        "Position": [20, 0, 10],
        "Orientation": [1, 0, 0, 0, 1, 0, 0, 0, 1],
        "File": "stud.dat"
      },
      "Ref": {
        "Position": [0, 0, 10],
        "Orientation": [1, 0, 0, 0, 1, 0, 0, 0, 1],
        "File": "stud.dat"
      },
      "Ref": {
        "Position": [-20, 0, 10],
        "Orientation": [1, 0, 0, 0, 1, 0, 0, 0, 1],
        "File": "stud.dat"
      },
      "Ref": {
        "Position": [20, 0, -10],
        "Orientation": [1, 0, 0, 0, 1, 0, 0, 0, 1],
        "File": "stud.dat"
      },
      "Ref": {
        "Position": [0, 0, -10],
        "Orientation": [1, 0, 0, 0, 1, 0, 0, 0, 1],
        "File": "stud.dat"
      },
      "Ref": {
        "Position": [-20, 0, -10],
        "Orientation": [1, 0, 0, 0, 1, 0, 0, 0, 1],
        "File": "stud.dat"
      }      
    }
  ]
}

I do not know the JSON format very well, so please be lenient when there are errors. This should only inspire the discussion.

With something like this it would be easy to add normals or uv-maps. It would be possible to create gradient brushes and for the rubber parts we could also add bones and bone weights ;-). It would be possible to add render-information (e.g. for the slopes) and we could add hide-conditions or something like that.

But: this would be a new format...

Rolf
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Re: Introducing a second library? - by Rolf Osterthun - 2015-02-19, 15:38
Re: Introducing a second library? - by Nicola - 2015-02-23, 16:19
Sergio Reano passed away - by Steffen - 2014-11-14, 23:10

Forum Jump:


Users browsing this thread: 1 Guest(s)