WebGL export

Info about new implemented features, classes, modules or APIs. Might get technical!
paullee
Posts: 97
Joined: Wed May 04, 2016 3:58 pm

Re: WebGL export

Postby paullee » Tue Jun 14, 2016 5:50 pm

dear all,

This feature is cool.

I am experimenting WebGL export and find sometimes the htmls seem return blank pages. Any idea? Thanks.

( BTW, can't upload the resulted *.html for reference)



OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.Unknown
Build type: Unknown
Python version: 2.7.11
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.8.0.oce-0.17
User avatar
yorik
Site Admin
Posts: 8563
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: WebGL export

Postby yorik » Tue Jun 14, 2016 8:55 pm

Probably for some reason the objects or your scene were not exported, there can be many reasons...
Try zipping your html file, you'll be able to attach it here. Attaching also your FreeCAD file could be useful
User avatar
bernd
Posts: 3872
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: WebGL export

Postby bernd » Tue Jun 14, 2016 10:12 pm

paullee wrote:dear all,

This feature is cool.

I am experimenting WebGL export and find sometimes the htmls seem return blank pages. Any idea? Thanks.

( BTW, can't upload the resulted *.html for reference)



OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.Unknown
Build type: Unknown
Python version: 2.7.11
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.8.0.oce-0.17
try hold right click and drag down your mouse.
paullee
Posts: 97
Joined: Wed May 04, 2016 3:58 pm

Re: WebGL export

Postby paullee » Wed Jun 15, 2016 2:35 pm

Thanks Bernd, I have found this trick earlier but it doesn't help in my situation.


bernd wrote:
paullee wrote:dear all,

This feature is cool.

I am experimenting WebGL export and find sometimes the htmls seem return blank pages. Any idea? Thanks.

( BTW, can't upload the resulted *.html for reference)



OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.Unknown
Build type: Unknown
Python version: 2.7.11
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.8.0.oce-0.17
try hold right click and drag down your mouse.
paullee
Posts: 97
Joined: Wed May 04, 2016 3:58 pm

Re: WebGL export

Postby paullee » Wed Jun 15, 2016 2:37 pm

Thanks, I tar.gz 3 different trials, one of them works.

BTW, I find the lines is broken / dotted but not continuous?


yorik wrote:Probably for some reason the objects or your scene were not exported, there can be many reasons...
Try zipping your html file, you'll be able to attach it here. Attaching also your FreeCAD file could be useful
Attachments
FreeCAD Webgl Export.tar.gz
(30.01 KiB) Downloaded 13 times
paullee
Posts: 97
Joined: Wed May 04, 2016 3:58 pm

Re: WebGL export

Postby paullee » Thu Jun 16, 2016 2:35 pm

After further trials with the model simplified, some output of htmls are ok.

Don't know the reason / logics behind yet.



yorik wrote:Probably for some reason the objects or your scene were not exported, there can be many reasons...
Try zipping your html file, you'll be able to attach it here. Attaching also your FreeCAD file could be useful
Attachments
Facade _ Study _ 02b2 _ part 2.fcstd
(438.9 KiB) Downloaded 9 times
FreeCAD Webgl Export 1.tar.gz
(960.25 KiB) Downloaded 9 times
paullee
Posts: 97
Joined: Wed May 04, 2016 3:58 pm

Re: WebGL export

Postby paullee » Sat Jun 18, 2016 2:48 am

Found a few problems in my case for sharing:-

1. The view clipping plane produced by the webgl export is too 'shallow' that it would miss the model easily - anything can be tweaked in the export setting?
2. The model may in default setting 'out of the view'
3. If the model is set to white colour (in my case), nothing could be seen in webgl/browser + the lines are dotted in the browser regardless of the planes / shapes' colour - ( adding light and shadow may help? )
4. The browser (firefox 47 on Fedora 23) performance in 3D start to be slow for an array of shapes (attached) - I have no problem and excellent smooth control for tens of array in FreeCAD - just great!


paullee wrote:After further trials with the model simplified, some output of htmls are ok.

Don't know the reason / logics behind yet.

yorik wrote:Probably for some reason the objects or your scene were not exported, there can be many reasons...
Try zipping your html file, you'll be able to attach it here. Attaching also your FreeCAD file could be useful
Attachments
FreeCAD Webgl Export 2.tar.gz
(375.86 KiB) Downloaded 11 times
paullee
Posts: 97
Joined: Wed May 04, 2016 3:58 pm

Re: WebGL export

Postby paullee » Tue Jun 21, 2016 6:26 am

Spend hours to dig into other posts here and find solution to a problem but some still not resolved:-

1. Change the THREE.PerspectiveCamera FAR parameter to x 100 and the complete models could be seen now
2. The problem is in fact no related to the model colour itself

But
3. All the lines of the model remains dotted / uncontinuous / almost illegible - do not know what is the problem yet. The FreeCAD built-in architectural model export with sharp edge lines, no problems.

Anyone have any idea on point 3 above?



paullee wrote:Found a few problems in my case for sharing:-

1. The view clipping plane produced by the webgl export is too 'shallow' that it would miss the model easily - anything can be tweaked in the export setting?
2. The model may in default setting 'out of the view'
3. If the model is set to white colour (in my case), nothing could be seen in webgl/browser + the lines are dotted in the browser regardless of the planes / shapes' colour - ( adding light and shadow may help? )
4. The browser (firefox 47 on Fedora 23) performance in 3D start to be slow for an array of shapes (attached) - I have no problem and excellent smooth control for tens of array in FreeCAD - just great!


paullee wrote:After further trials with the model simplified, some output of htmls are ok.

Don't know the reason / logics behind yet.

yorik wrote:Probably for some reason the objects or your scene were not exported, there can be many reasons...
Try zipping your html file, you'll be able to attach it here. Attaching also your FreeCAD file could be useful
paullee
Posts: 97
Joined: Wed May 04, 2016 3:58 pm

Re: WebGL export

Postby paullee » Tue Jun 21, 2016 6:33 pm

Still unresolved ... lines are broken ....

Test.png
Test.png (26.37 KiB) Viewed 1877 times


paullee wrote:Spend hours to dig into other posts here and find solution to a problem but some still not resolved:-

1. Change the THREE.PerspectiveCamera FAR parameter to x 100 and the complete models could be seen now
2. The problem is in fact no related to the model colour itself

But
3. All the lines of the model remains dotted / uncontinuous / almost illegible - do not know what is the problem yet. The FreeCAD built-in architectural model export with sharp edge lines, no problems.

Anyone have any idea on point 3 above?



paullee wrote:Found a few problems in my case for sharing:-

1. The view clipping plane produced by the webgl export is too 'shallow' that it would miss the model easily - anything can be tweaked in the export setting?
2. The model may in default setting 'out of the view'
3. If the model is set to white colour (in my case), nothing could be seen in webgl/browser + the lines are dotted in the browser regardless of the planes / shapes' colour - ( adding light and shadow may help? )
4. The browser (firefox 47 on Fedora 23) performance in 3D start to be slow for an array of shapes (attached) - I have no problem and excellent smooth control for tens of array in FreeCAD - just great!


paullee wrote:After further trials with the model simplified, some output of htmls are ok.

Don't know the reason / logics behind yet.

yorik wrote:Probably for some reason the objects or your scene were not exported, there can be many reasons...
Try zipping your html file, you'll be able to attach it here. Attaching also your FreeCAD file could be useful
triplus
Posts: 4857
Joined: Mon Dec 12, 2011 4:45 pm

Re: WebGL export

Postby triplus » Tue Jun 21, 2016 7:31 pm

@paullee

Sorry i can’t help out. I guess current WebGL support in FreeCAD is rather basic and without substantial effort put into it this won't change.

Few days back i found this project:

http://www.babylonjs.com/

http://www.babylonjs-playground.com/

And it looks good. Produced models are of good quality and the performance is great. Maybe we could use it in FreeCAD in the future to get better results.