convert 3d geometry to gltf

I want to express 3d geometry in gltf. (want to use in cesium js)

Fist, convert the coordinates to ECEF coordinates.
Next, I created a gltf file.

However, it does not look neat on the preview screen. (ms code extension)
And trembling occurs when moving.

I want to know the cause.

** coordinates (epsg 4326 , height)
-73.561001356474, 45.4966833629139, 19.9
-73.5610780383518, 45.4967314096038, 19.9
-73.5610843141094, 45.4967252603133, 19.9
-73.561001356474, 45.4966833629139, 19.9

** preview gltf (ms code extension)
캡처

** gltf source

{
  "scenes" : [
    {
      "nodes" : [ 0 ] 
    }
  ],

  "nodes" : [       
    {
      "mesh" : 0
    }
  ],

  "meshes" : [      
    {
      "name": "gltf test",
      "primitives" : [ 
        {
        "attributes" : {
          "POSITION" : 1
        },
        "indices" : 0,
        "mode": 4
      } 
    ]
    }
  ],

  "buffers" : [
    {
      "uri" : "data:application/octet-stream;base64,AAABAAIAAAAYtZpJTBWDyiIhikritJpJSBWDyiohikrftJpJSRWDyikhiko=",
      "byteLength" : 44
    }

  ],
  "bufferViews" : [
    {
      "buffer" : 0,
      "byteOffset" : 0,
      "byteLength" : 6,
      "target" : 34963
    },
    {
      "buffer" : 0,
      "byteOffset" : 8,
      "byteLength" : 36,
      "byteStride": 12,
      "target" : 34962
    }
  ],
  "accessors" : [
    {
      "bufferView" : 0,
      "byteOffset" : 0,
      "componentType" : 5123,
      "count" : 3,
      "type" : "SCALAR"
    },
    {
      "bufferView" : 1,
      "byteOffset" : 0,
      "componentType" : 5126,
      "count" : 3,
      "type" : "VEC3",
      "min" : [ 1267355.8953368044, -4295333.93970134, 4526225.02467026],
      "max" : [ 1267363.054331189, -4295331.983019848, 4526228.767742585]
    }
  ],

  "asset" : {
    "version" : "2.0"
  }
}

Responded on Stack Overflow: cesiumjs - convert 3d geometry to gltf - Stack Overflow

1 Like

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.