I would like to ask how do I import this model so that it is presented as a rectangular line instead of a face
This is my test model: 111.zip (371 Bytes)
Thanks for your reply! I think there may be some mistakes in my description. I hope to import the model (wire frame or line) from outside to BABYLON, but it turns into a face after it is imported into babylon.
I hope you can import the line to babylon normally
Well. We hope to import lines built by other modeling software, such as AUTOCAD, into BABYLON for processing, but at present, it is impossible to achieve this
I tried the same code before but there was not an mtl file available on the server and it created the mesh with zero vertices, this is why I incorrectly answered here (Import .obj model to scene - #8 by roland). I reexported it from Blender to generate the mtl file and voila! mesh.getVerticesData(BABYLON.Constants.PositionKind) now returns the positions correctly. I think the SceneLoader should load the geometry alone from the obj file even if the mtl file is not available.
Does this mean that we need to know that the imported model is a ‘line’ in order to do this?
Now we are working on a function to import models built by other modeling software into babylon environment, including stl, obj, gltf and other formats. Normal 3D models can be successfully imported directly through the babylon api. If you import ‘lines’, it seems that there is now no way to tell whether the imported model is’ lines’ or 3D.
1-There is actually a model already imported into the scene, but the data structure is a ‘line’ data structure, rendered as a triangle so it cannot be seen.
2-We already know that the import is a ‘line’, so based on the result returned by the import, use GreasedLine to recreate the ‘line’.
We want to import any model (including 2D lines, 3D) into babylon scene and it will display properly.
However, we tested that the 3D model could be imported normally, but the 2D line could not be imported normally.
Unfortunately,there is no way to judge whether the imported model is 2D or 3D.