WebGL export
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
WebGL export
The Arch module now features WebGL export. It uses the famous Three.js library, by downloading a packed version of that library and embedding it in the exported file at export time. The result is a standalone HTML file that can be viewed with any WebGL-capable web browser.
There are still many caveats, mainly:
- I still couldn't think of a nice scheme for the camera position (currently it more or less adopts the position of the camera from the freecad viewport), and ideally there should be controls to rotate the camera around the objects
- Materials and lights should be implemented better (currently only uses a dumb basic material)
I hope some webgl specialist arises and helps me with that!
There are still many caveats, mainly:
- I still couldn't think of a nice scheme for the camera position (currently it more or less adopts the position of the camera from the freecad viewport), and ideally there should be controls to rotate the camera around the objects
- Materials and lights should be implemented better (currently only uses a dumb basic material)
I hope some webgl specialist arises and helps me with that!
Re: WebGL export
Thats really cool!
I did some research some years ago on WebGL. But now it seams its getting much more mature!
But it seams there is still no good Viewer with mouse interaction out there...
I did some research some years ago on WebGL. But now it seams its getting much more mature!
But it seams there is still no good Viewer with mouse interaction out there...
Stop whining - start coding!
Re: WebGL export
Actually yesterday I played a bit with Dan Falck about that... I'll try to have a basic viewer soon (mouse rotate + zoom).
Ideal would be something like this: http://carvisualizer.plus360degrees.com/threejs/
Ideal would be something like this: http://carvisualizer.plus360degrees.com/threejs/
Re: WebGL export
Did you have a look on http://scenejs.org/ ?
They seem to have some selection methode:
http://www.youtube.com/watch?v=PV1LDgVCU6E
They seem to have some selection methode:
http://www.youtube.com/watch?v=PV1LDgVCU6E
Stop whining - start coding!
Re: WebGL export
I hope this topic inspired you at least a bit:
viewtopic.php?f=10&t=2397&start=0
Great indeed. I think stuff like WebGL, HTML5, JavaScript, SVG ... represent challenges but it's ideal for FOSS projects because having any modern web browser acting as viewer for FreeCAD models/files is cutting edge and if there will be something like part database in the future preview with web browser could be implemented too...
viewtopic.php?f=10&t=2397&start=0
Great indeed. I think stuff like WebGL, HTML5, JavaScript, SVG ... represent challenges but it's ideal for FOSS projects because having any modern web browser acting as viewer for FreeCAD models/files is cutting edge and if there will be something like part database in the future preview with web browser could be implemented too...
Re: WebGL export
Ah yes, scene.js is the concurrent of three.js... I think both are very similar...
That bim surfer is pretty cool, I had seen it already... it works with the http://www.bimserver.org which is also cool (I'll make a plugin for it in freecad one day, when we have IFC export done)
I just committed a new version of the webgl exporter, now it has mouse controls (LMB to rotate, MMB to zoom, RMB to pan), and the rendering window occupies the whole available space. I also added wireframe rendering so it's easier to see your stuff...
That bim surfer is pretty cool, I had seen it already... it works with the http://www.bimserver.org which is also cool (I'll make a plugin for it in freecad one day, when we have IFC export done)
I just committed a new version of the webgl exporter, now it has mouse controls (LMB to rotate, MMB to zoom, RMB to pan), and the rendering window occupies the whole available space. I also added wireframe rendering so it's easier to see your stuff...
Re: WebGL export
LOL, triplus vindicated at last.triplus wrote:I hope this topic inspired you at least a bit:
You guys are aware of Shapesmith right? A web-based modeler that was based on OCC. Turns out the developer will abandon OCC in v2.0 because it brings too much complexity. He only wants it to generate models for 3D printing, so STL output doesn't really require a real CAD kernel. Not sure what library he uses to render.
A web viewer able to directly view FCStd files would be awesome, but I guess that would require some background conversion from FCStd to mesh. And I still say that the cloud is not the answer to all things.
Re: WebGL export
You'll be happy then, try the latest version...normandc wrote:A web viewer able to directly view FCStd files would be awesome
Re: WebGL export
The problem one year back was it was just ideas now there is something anybody can actually test. In the future there will probably be some (local/online) repository anybody will be able to upload/download it's models/parts. This will represent cloud for storing/retrieving parts and this first step Yorik did is basically adding support to be able to preview the part with web browser or opening FreeCAD and having search box on the start page or in Assembly Workbench where you can actually browse and view parts before you choose the ones you will use... There is nothing wrong with cloud like that in my opinion if you can host your local copy if you want.And I still say that the cloud is not the answer to all things.
This is the feature bigger CAD companies will copy in the future and FreeCAD was there/here first!
Re: WebGL export
That I can agree with.triplus wrote:There is nothing wrong with cloud like that in my opinion if you can host your local copy if you want.
IMO we are too trusting of big corporations and their forced cloud solutions. After all the philosophy of FOSS is control over your programs and your own data.
Just an example of how the cloud can screw you: Tinkercad was a very popular and user-friendly free online modeling program. You could only save your projects on their server, or export to STL. Well they announced they are shutting down everything by end of April, with only one month notice. I'm sure people who somehow didn't get the news will have a bad surprise when they attempt to get to their projects after next month.
OK, sorry for the off topic... Stepping down the soap box now.