Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 4
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 1118 times and has 3 replies Next Thread
nurettin
Newbie



turkey
Joined: Aug 14, 2018
Post Count: 3
Status: Offline
Reply to this Post  Reply with Quote 
applause Adding markers that won't be lost when I export to obj

Hi, 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.
[Aug 14, 2018, 10:14:49 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
nurettin
Newbie



turkey
Joined: Aug 14, 2018
Post Count: 3
Status: Offline
Reply to this Post  Reply with Quote 
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.
[Aug 14, 2018, 12:30:17 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
nurettin
Newbie



turkey
Joined: Aug 14, 2018
Post Count: 3
Status: Offline
Reply to this Post  Reply with Quote 
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.


[Aug 14, 2018, 3:28:27 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9141
Status: Offline
Reply to this Post  Reply with Quote 
Re: Adding markers that won't be lost when I export to obj

Nice try! smile

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 developer
[Aug 16, 2018, 6:02:57 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved