tbfleming / jscut

In-browser CAM package
http://jscut.org
GNU General Public License v3.0
295 stars 136 forks source link

Simplified g-code view for those unlucky enough to not have WebGL working #55

Closed Harvie closed 7 years ago

Harvie commented 7 years ago

I can't get WebGL working in chrome because of some problems with my drivers. Can you please make some simplified version of g-code simulator that would show at least some static 3D views from various angles?

tbfleming commented 7 years ago

WebGL is the best way to produce 3D views in the browser; other methods would take a large amount of development time and benefit few users.

Harvie commented 7 years ago

You can easily produce 2D output. Eg. using canvas. Just ignore one axis and voila. You have 2D image of 3D code. Do this three times, once for each axis to be ignored and you have 2D view from 3 different angles. Quite easy.

tbfleming commented 7 years ago

No, it requires a completely different code base. See https://www.youtube.com/watch?v=tgVLb6fOVVc for an intro to WebGL; it's nothing like the 2D canvas.

tbfleming commented 7 years ago

You're going to run into more and more pages that rely on WebGL, even for 2D stuff. WebGL outperforms the 2D canvas when you need to draw roughly 10,000 lines or more, assuming you use the WebGL API well. WebGL scales to around a million lines at a decent frame rate, something that causes the 2D canvas to choke.