Is there any repository or tool I can use to easily convert a TIFF to a glTF? I don’t want to reinvent the wheel and learn the file formats for both files if there is already a good project out there.
Since TIFF is an image format and glTF is a 3D scene format, it’s not obvious what “converting” one to the other would mean. Are you hoping to create a 3D scene containing a floating rectangle, and display the image from the TIFF file on that rectangle? Or something else?
Sorry, I definitely didn’t realize the TIFF format was more generic than my type is. My TIFF file is a digital elevation map - it’s essentially a grid of numbers that represent elevation, so you can think of it as a gridded point cloud. There must be information in the header about the dimensions of this grid.
I want to take this gridded point cloud and convert it into a triangulated mesh, the Delaunay Triangulation is the algorithm I used in the past to achieve this result. However my old code is no longer appropriate so I am looking for something that can do this for me so I don’t have to reimplement this algorithm.
That’s the other way around. A TIFF is only an image. A glTF file can reference images, but also mesh data and other structural elements of a scene.
Someone may have created a tool to turn an image representing a hightmap into a mesh, but I don’t know of any such tool.
I think glTF is perhaps not appropriate for what I am trying to do. I want to render a 3d model in a scene using THREE.js and they recommended glTF, but really I don’t need a whole scene - just a 3d model in .obj format.
A “whole scene” can contain a single 3D model. Besides, you need some way to position and resize the model for viewing, right? So you’re still rendering a scene, even if you don’t think of it that way.
I need a way to do collision detection of a sphere onto the triangulated mesh - is it possible to programmatically interact with the scene elements of a glTF file, or would be be better to have a separate model for the triangulated mesh?
I can position and resize the model using the THREE.js matrix transformations.
I guess my question now is - what is the advantage of the entire scene being inside of one glTF file as opposed to using .obj files and implementing the logic myself? THREE.js recommends glTF, but I don’t know enough about the project to know if it’s useful for me.
glTF is a more efficient format, and supports more modern features (materials, animations, compression) than OBJ. But at the end of the day once you’ve loaded it into your three.js scene, your geometry is just a collection of THREE.Mesh objects in three.js, regardless of what format was originally used to create them. So you can interact with that (raycast, compute bounding boxes, etc.) in the same way with either format.