WebGL export

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: WebGL export

Post by paullee »

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
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: WebGL export

Post by yorik »

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
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: WebGL export

Post by bernd »

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
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: WebGL export

Post by paullee »

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
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: WebGL export

Post by paullee »

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 137 times
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: WebGL export

Post by paullee »

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 153 times
FreeCAD Webgl Export 1.tar.gz
(960.25 KiB) Downloaded 169 times
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: WebGL export

Post by paullee »

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 162 times
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: WebGL export

Post by paullee »

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
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: WebGL export

Post by paullee »

Still unresolved ... lines are broken ....
Test.png
Test.png (26.37 KiB) Viewed 4952 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
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: WebGL export

Post by triplus »

@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.
Post Reply