Export to HTML5 plug-in

This topic has been viewed 4958976 times and has 152 replies
Thread status: Active
Test the features and bug fixes of future versions [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
Post Reply New Topic
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Export to HTML5 plug-in

Post by Puybaret »

Sorry, I forgot to mention that you should call [font=courier new]setAerialViewCenteredOnSelectionEnabled(true)[/font] on user preferences available in HomePreviewComponent. Hope it will work this time...
Emmanuel Puybaret, Sweet Home 3D creator
omrico
Posts: 4
Joined: Tue Dec 26, 2017 8:54 pm

Re: Export to HTML5 plug-in

Post by omrico »

It worked, thank you!
User avatar
Gildaniel
Posts: 135
Joined: Fri Aug 11, 2017 10:57 am
Country: Russia

Re: Export to HTML5 plug-in

Post by Gildaniel »

Hello!

Could you please help me: is it possible to insert some code into html in order iframe with 3d-model opens in new browser tab in full screen mode?

My code:
<body>
<script type="text/javascript" src="/3dplan/newlib/big.min.js"></script>
<script type="text/javascript" src="/3dplan/newlib/gl-matrix-min.js"></script>
<script type="text/javascript" src="/3dplan/newlib/jszip.min.js"></script>
<script type="text/javascript" src="/3dplan/newlib/core.min.js"></script>
<script type="text/javascript" src="/3dplan/newlib/geom.min.js"></script>
<script type="text/javascript" src="/3dplan/newlib/batik-svgpathparser.min.js"></script>
<script type="text/javascript" src="/3dplan/newlib/jsXmlSaxParser.min.js"></script>
<script type="text/javascript" src="/3dplan/newlib/triangulator.min.js"></script>
<script type="text/javascript" src="/3dplan/newlib/viewmodel.min.js"></script>
<script type="text/javascript" src="/3dplan/newlib/viewhome.min.js"></script>


<style type="text/css">
/* The class of components handled by the viewer */
.viewerComponent {
}
</style>

<div class="logo"style="text-align: center">
<a href="/"><img src="/bitrix/templates/regard/img/regard.svg"></a>
</div>
<br>
<br>



<H1 style="text-align: center; text-decoration:underline; cursor: pointer"
onclick='viewHomeInOverlay("House 23.sh3d",
{roundsPerMinute: 1,
widthByHeightRatio: 4/3,
navigationPanel: "none",
aerialViewButtonText: "Aerial view",
virtualVisitButtonText: "Virtual visit",
level: "2 floor",
selectableLevels: ["1 floor", "2 floor", "Roof"],
activateCameraSwitchKey: true,
viewerControlsAdditionalHTML: "",
readingHomeText: "Loading",
readingModelText: "House",
noWebGLSupportError: "No WebGL support"
})'
>TAP HERE TO OPEN 3D-MODEL IN NEW TAB</H1>



Thank you!
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Export to HTML5 plug-in

Post by Puybaret »

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
ReaperSoon
Posts: 4
Joined: Mon Jun 12, 2017 9:38 am
Country: France
Contact:

Re: Export to HTML5 plug-in

Post by ReaperSoon »

Hi everyone,

For whose want to use the exported house using this plugin in wordpress I developed a plugin for wordpress that is really easy to use : https://fr.wordpress.org/plugins/embed-sweethome3d

I will update it to add for flexibility in future.

Regarde,
Steve
ReaperSoon
Posts: 4
Joined: Mon Jun 12, 2017 9:38 am
Country: France
Contact:

Re: Export to HTML5 plug-in

Post by ReaperSoon »

Hi, I need to disable the automatic scroll to the canvas, but your JS sources are minified and I cannot find the scroll function.
How to disable it ?

Thanks
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Export to HTML5 plug-in

Post by Puybaret »

Source code of SweetHome3DJS project can be found in the archive SweetHome3DJS-6.1-src.zip and in SVN repository.
I hoped that [font=courier new]stopPropagation[/font] 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
ReaperSoon
Posts: 4
Joined: Mon Jun 12, 2017 9:38 am
Country: France
Contact:

Re: Export to HTML5 plug-in

Post by ReaperSoon »

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 ?

Thanks
ReaperSoon
Posts: 4
Joined: Mon Jun 12, 2017 9:38 am
Country: France
Contact:

Re: Export to HTML5 plug-in

Post by ReaperSoon »

Ok I found. I removed this line : https://sourceforge.net/p/sweethome3d/c ... me.js#l642

The focus was auto scrolling to the element.

Thanks
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Export to HTML5 plug-in

Post by Puybaret »

Thanks, it explains why I had the same issue in that page.
I thought you were speaking about unwanted scrolling that may happen when the 3D view is displayed in an overlay on long pages and you press page up or down keys.

Completely removing focus might not be the best idea. Maybe it should request focus only if the 3D view is at screen.
Emmanuel Puybaret, Sweet Home 3D creator
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 2 guests