Better HN
topnewbestaskshowjobs
Log inSign up

tincture

9 karma · joined Dec 11, 2016 (9y ago) · 2 submissions

Submissions

comment 9y ago · link · parent

WebGL doesn't really understand "file formats", so you're left to load the file into a buffer yourself. JSON is a reasonable way to do that.

Once you hand off the vertices to the WebGL context, it's all the same bits; your file loading strategy has no performance or memory impact.

comment 9y ago · link · parent

If you're already familiar with Javascript, and you want to learn WebGL, I recommend just diving into THREE.js instead.

The problem with this tutorial is that almost all of it is hidden behind an opaque "loadWFObj", so you don't get the critical aha moments of "wait so the model is just a bunch of 3d triplets?", "whoa every camera is just a 4x4 matrix you multiply by", and "shaders are a C program that runs on a pixel".

I promise you'll pick up all of these things naturally by fiddling around with THREE.js. But, you probably won't get there by copying a WebGL context initialization example that does everything interesting inside an opaque library.