|
Sweet Home 3D Forum » List all forums » » Forum: Features use and tips » » » Thread: Adding markers that won't be lost when I export to obj |
|
| Print at Dec 20, 2025, 10:06:19 AM | View all posts in this thread on one page |
| Posted by nurettin at Aug 14, 2018, 10:14:49 AM |
Adding markers that won't be lost when I export to objHi, this question is about importing sweet home 3d generated obj files into THREE.js and detecting points of interest from within javascript. I can see that the object names, material names and coordinates are exported into the obj file. Is there any way to influence what name will be used for a certain 3d object? Ideally, I would like to leave markers on the floor (tiny boxes or balls), name them and when the model is loaded with THREE.OBJLoader, I would like to see their names inside the javascript object. For that, the model needs to be exported with customizable names. I tried naming objects, but the sh3d exporter renames them according to some algorithm so I can't get the names back when I load the object. I could also find the centers of floors within javascript. Not ideal, but worth a try. For that, I tried creating a model with two rooms with separate floors, but the exported obj file only has ground_1. Another alternative is to find out how the floor maps into 3d coordinates and inject the points of interest from within javascript, but that requires me to do extra programming work. Any ideas would be appreciated. Thanks. |
| Posted by nurettin at Aug 14, 2018, 12:30:17 PM |
|
Re: Adding markers that won't be lost when I export to obj I created another house plan, exported to obj and it outputted g room_ objects. I am currently experimenting on getting the bounding spheres of `g room_` objects and calculating their centers. It looks promising so far. |
| Posted by nurettin at Aug 14, 2018, 3:28:27 PM |
|
Re: Adding markers that won't be lost when I export to obj I managed to find the center coordinates of floor bounding spheres in javascript. The spheres also get their unique names from the sweethome3d obj export. Appears to be working so far. ![]() |
| Posted by Puybaret at Aug 16, 2018, 6:02:57 PM |
|
Re: Adding markers that won't be lost when I export to obj Nice try! You could also use Sweet Home 3D JS Viewer to display SH3D files. Its JavaScript API lets you directly handle objects as rooms, walls and furniture and proposes a picking method to detect the object on which the user clicks, as demoed by openHAB. ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
|
|
Current timezone is GMT Dec 20, 2025, 10:06:19 AM |