3D graphics rendering pipeline. Implemented in JavaScript. Run in a terminal
github.com
github.com
https://github.com/glouw/gel/blob/master/main.c
But you are right. It does take some ingenuity to make it clean.
Can anyone clarify?
Hmmm, sometimes it’s “from one version of a language to another version of the same language”. As is the case with Babel[0] and JavaScript.
No I think transpile implies compiling from one level of abstraction to another similar level of abstraction, which is quite different in theory and practice to compiling to a much lower level of abstraction. It's a useful word to have in your communication toolbox.
But I do wonder about the actual usefulness of the distinction. If someone says that they compile Typescript to Javascript, I'm not sure that anyone is going to be confused about what is meant, even if violates the letter of the dictionary definition.
Ultimately, english is fluid and is always correct as long as those in communication are able to understand each other. For transpile to be a useful word in the toolbox, there must be a circumstance where compile cannot be used to convey the same idea. When might that be?
What is the difference, if there's one well-defined language before the pass and another after it?
>A non-optimising C to assembly compiler is not compiling to the same level of abstraction.
Neither are "transpilers", otherwise they'd be quite useless. Abstraction isn't a linear hirerarchy, in any case.
The term's been in use since the 60s, when most compilers were not optimising.
Or does it only count as "transpilation" if the intermediate representation is an already existing language, thus making the distincion purely based on the history of a language, not the implementation?
*not exactly, there’s a couple of features that map differently. But there's a 1:1 TS to JS conversion.
What you type is usually considered what it's implemented in, not what it's compiled/transpiled to. The later is the target language, which there may be many.
This differentiation is required if you want to modify/read the code. You would almost certainly modify/read it in the language it was implemented in, and make it clear which language this is when sharing.
Maybe "...implemented in TS, targeting JS" or at least something more obvious like "...implemented in JS using TS".
As someone with very little knowledge of computer graphics, are there any resources anyone would recommend in order to learn how to build something like this?
Note that when you're building test cases, matrix multiplication is not commutative.
My high school teacher literally just pointed me at the Wikipedia article and said go:
https://en.wikipedia.org/wiki/Matrix_multiplication
The next step up from that is to then render meshes using some form of projection (isometric or perspective). You'll need to figure out how to actually map the drawing to the screen at that point. (In high school we just used the built-in 2D methods in Java. Some of my classmates then went on to shading and textures, but I didn't quite get that far.)
https://en.wikipedia.org/wiki/Ray_casting
Of course it has more to do with raytracing than with 3D projections (which is most often used for real time 3D rendering). If you want to learn about 3D projections, first you should understand what linear algebra has to do with projecting a 3D model on a 2D screen. This is probably a good start.
https://en.wikipedia.org/wiki/3D_projection
And then, learning about matrix multiplications makes sense.
For rendering at rates measured in seconds per frame, consider the "Physically Based Rendering Textbook", currently on its 3rd edition. https://www.pbrt.org/
Also nice to see a Douglas Crockford book (who is not a fan of TS BTW) ...
Anyways I star'd this repo ... very impressive +1
This project is awesome though.
(See: Recursion)