Joined: Dec 26, 2017
Post Count: 4
Status:
Offline
Re: Export to HTML5 plug-in
Selecting an object of the displayed home should have the same effect as in Sweet Home 3D. From the HomePreviewComponent returned by viewHome, you'll be able to access to the displayed Home instance, which lets you access to all its objects and select the ones you want with its setSelectedItems method.
I tried what you said but didn't succeed with changing the camera. I fetched all the selected items via
getSelectableViewableItems()
function and randomly chose an object from the array. Then used
setSelectedItems(selectedItems)
function but the camera didn't change the angle and position. What am I missing here? Thank you.
France
Joined: Nov 7, 2005
Post Count: 9430
Status:
Offline
Re: Export to HTML5 plug-in
Sorry, I forgot to mention that you should call setAerialViewCenteredOnSelectionEnabled(true) on user preferences available in HomePreviewComponent. Hope it will work this time...
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
France
Joined: Nov 7, 2005
Post Count: 9430
Status:
Offline
Re: Export to HTML5 plug-in
I just released the version 1.4 of Export to HTML5 plug-in to support the new features of Sweet Home 3D 6.0, even if Sweet Home 3D JS Viewer 6.0 should make this plug-in less useful (actually, it's still useful if you want to reduce the SH3D file to render).
New features in the 3D view are shown in the following scene, mainly: - polylines and blueprint at ground can be displayed in 3D, - texts can be written on more than one line with alignment, - transformations can be applied on 3D models like doors, windows and a new mannequin - textures can be shifted along their width and height, and X offset on sky texture is used to rotate it around the azimuth.
Of course, all these features are still accessible in JavaScript through the updated API to let you read or change the data you want.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
France
Joined: Nov 7, 2005
Post Count: 9430
Status:
Offline
Re: Export to HTML5 plug-in
Source code of SweetHome3DJS project can be found in the archive SweetHome3DJS-6.1-src.zip and in SVN repository. I hoped that stopPropagation calls on key events in HomeComponent3D.js would be enough, but in some browsers, this trick is not enough.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
France
Joined: Jun 12, 2017
Post Count: 4
Status:
Offline
Re: Export to HTML5 plug-in
Thanks for the src! But it nos scrolls with an event. It just scollTo the canvas when I open my page. My sh3d is embed in the middle of my page and when I open it, the scroll is directly in the middle of the page centered to the canvas. Is it a wanted feature ?