melowntech / vts-tools

VTS tool suite.
BSD 2-Clause "Simplified" License
12 stars 3 forks source link

Unable to generate 3D datasets from obj file #8

Open Kaligos opened 2 years ago

Kaligos commented 2 years ago

Hi,

It's been a while now that i'm trying to integrate 3D data based on obj files representing small part of cities in France.

First, I tried to convert the obj file to Vef format using a homemade script but for some reason, I had a core dump from vef2vts without any further details.

So, I decided to try the 3DTiles format using obj23dtiles converter.

With the gltf format, i got an "unsupported archive type <text/plain>" issue.

Then I tried to use glb format but I had "unsupported archive type <application/octet-stream>" issue.

Finally, I did a zip archive of b3dm file with a tileset.json by running:

obj23dtiles -i /path/to/model3d_light.obj --tileset

I also replaced the refine operation "ADD" by "REPLACE" as the 3dtiles2vts tool told me it was the only supported refined operation.

But this time I get the following output:

2021-09-08 15:11:05 I3 [12671(main)]: Analyzing input dataset (1 3D Tiles). {3dtiles2vts.cpp:analyze():438}
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::bad_lexical_cast> >'
  what():  bad lexical cast: source type value could not be interpreted as target
Aborted (core dumped)

It seems to be my best try so far.

My tileset.json:

{
  "asset": {
    "version": "0.0",
    "tilesetVersion": "1.0.0-obj23dtiles",
    "gltfUpAxis": "Y"
  },
  "geometricError": 200,
  "root": {
    "transform": [
      0.9686356343768792,
      0.24848542777253735,
      0,
      0,
      -0.15590905719491865,
      0.6077582491450705,
      0.7786669868953672,
      0,
      0.19348739933104805,
      -0.7542445908197271,
      0.6274374259791091,
      0,
      170987.5786351309,
      -666536.7188188545,
      550763.5467591449,
      1
    ],
    "boundingVolume": {
      "region": [
        -1.2060485351744672,
        0.6985067501067099,
        -1.1964880482656544,
        0.69891110895771,
        0,
        916
      ]
    },
    "geometricError": 0,
    "refine": "REPLACE",
    "content": {
      "url": "model3d_light.b3dm"
    }
  }
}

My command line looks like:

3dtiles2vts --input /media/hdd/dataset/city/model3d_light.zip --output /var/vts/store/resources/tilesets/GS_model3D_light --tilesetId GS_model3D_light --referenceFrame melown2015

Note that I tried a lot of operation on input data (simplifcation, remove texture, different set of data) but I always get the same issue. However, I didn't try with some example data from VTS.

I don't know what's wrong here. I'm not sure about the input EPSG but i think it's WGS84 so it might cause issue with the melown2015 frame that is in pseudomerc, i'm not sure about that.

I'm using vts-tools 1.93.

I'll take any idea on how to fix that :)

Thank you.

jrjdavidson commented 2 years ago

Hi Kaligos,

Not a dev here but just thought I'd pitch in. How are you generating the obj models? Could you make another format instead? I create slpk tiled models of buildings and cliffs using drone footage and Agisoft metashape, and it works great in vts- definitely my favourite feature of this software.

Kaligos commented 2 years ago

Hi @jrjdavidson,

Well the obj are coming from drone scans but it's not made by me. I can ask the guy who gave me the data if he can do an splk but i'm not sure he can.

If i can't fix this issue, i'll try to make slpk myself but i think I would need Arcgis software to do so.

Thanks for your answer ;)

jrjdavidson commented 2 years ago

if you have the drone photos, it is fairly straightforward to create a tiled model from metashape. I think you can get a trial version of metashape (I think the limitation of the trial is that you can't save a project).