Tag Archives: graphics

Exploring the PNG Image File Format with a PNG Viewer in JavaScript

The JavaScript program below, when run, prompts the user to upload a PNG file and displays that image. To see the code in action, copy it into an .html file and open that file in a web browser that runs … Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Rendering to Texture with WebGL

The JavaScript program below, when run, will display a simple three-dimensional scene rendered with WebGL. It is nearly identical to a program from a previous post, except that this version demonstrates how to render a scene to a texture, rather … Continue reading

Posted in Uncategorized | Tagged , , , , , , , | Leave a comment

A Rudimentary Mesh Editor in JavaScript

The code below implements a rudimentary editor for three-dimensional forms called “meshes”. To see it in action, copy it into an .html file and open that file in a web browser that runs JavaScript. Or, for an online version, visit … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment

Drawing a Rotated Image to an HTML5 Canvas

The JavaScript code below, when run, prompts the user to specify an image file to be uploaded, and then displays that image, scaled to 100 x 100 pixels and rotated 45 degrees clockwise in the center of an HTML5 canvas.

Posted in Uncategorized | Tagged , , , , | Leave a comment

An Pixel Art Editor in JavaScript

The JavaScript below implements a simple image editor for editing very tiny images pixel-by-pixel. To see it in action, copy it into an .html file and open that file in a web browser that runs JavaScript. Or, for an online … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

A Parallelization-Ready Ray Tracer in JavaScript

The JavaScript code below implements a ray tracer in JavaScript. It is based on an earlier version in a previous post, but has been cleaned up and refactored somewhat, with an eye towards eventually making splitting the view to be … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment

TrueType Fonts in JavaScript with Font-Face

The JavaScript code below, when run, presents an interface that allows the user to specify a font file in TTF format and some text to render in that font. Then, when the button is clicked, the specified text is rendered … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment