<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by RAYNARD DODZI on Medium]]></title>
        <description><![CDATA[Stories by RAYNARD DODZI on Medium]]></description>
        <link>https://medium.com/@dodziraynard?source=rss-2033a036a926------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*aOtHcpSy4hR7LT8-.jpg</url>
            <title>Stories by RAYNARD DODZI on Medium</title>
            <link>https://medium.com/@dodziraynard?source=rss-2033a036a926------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 05:08:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dodziraynard/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Drawing Your First Triangle with WebGL: A Practical Guide]]></title>
            <link>https://dodziraynard.medium.com/drawing-your-first-triangle-with-webgl-a-practical-guide-3868a2af9f2c?source=rss-2033a036a926------2</link>
            <guid isPermaLink="false">https://medium.com/p/3868a2af9f2c</guid>
            <dc:creator><![CDATA[RAYNARD DODZI]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 13:36:25 GMT</pubDate>
            <atom:updated>2025-12-31T13:36:25.374Z</atom:updated>
            <content:encoded><![CDATA[<p>In my <a href="https://medium.com/@dodziraynard/building-motion-from-scratch-my-journey-into-technical-video-animations-40689643a1a4">previous article</a>, I explored why I chose to build a technical video editor using Rust and WebGL2. Today, we will get hands-on by setting up our development environment and rendering our first geometric shape on the canvas.</p><p><strong>The Challenge: Bridging Rust and the Browser</strong></p><p>Here is the interesting problem: WebGL is a JavaScript API, which means we cannot interact with it directly from Rust. Additionally, browsers are not designed to execute arbitrary binaries for security reasons. The solution? <strong>WebAssembly</strong> — our bridge between Rust and the browser’s WebGL API.</p><p>Below is the architecture we are working towards. In this article, we will focus specifically on the final component: <strong>Drawing Geometry Using WebGL</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pW9IBzjlmmhbNDtPsuvg4g.png" /><figcaption>Target Architecture</figcaption></figure><p><strong>Before We Begin</strong></p><p>My goal with this series is not to provide a comprehensive tutorial on each individual technology, but rather to show you how to compose them effectively to build a web-based technical video tool. If you are new to WebGL, I highly recommend these excellent resources:</p><ul><li><a href="https://webglfundamentals.org/webgl/lessons/webgl-fundamentals.html">WebGL Fundamentals</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API">MDN WebGL API Documentation</a></li><li><a href="https://github.com/dodziraynard/graphics-articles/tree/master/24-12-2025-webgl-for-technical-communication-videos">Complete Source Code</a></li></ul><p><strong>Understanding the WebGL Pipeline</strong></p><p>WebGL operates through a <strong>shader-based rendering pipeline</strong>. We interact with WebGL through the rendering context of an HTML canvas element. At the core of WebGL are <strong>shaders</strong>, programs that run directly on your GPU.</p><p>There are two types of shaders in WebGL:</p><p>1. <strong>Vertex Shader</strong>: Defines the geometry of your shape by processing each vertex. This shader runs once for every vertex in your shape, determining its position in space.</p><p>2. <strong>Fragment Shader</strong>: Determines the color of each pixel within the region defined by your vertices. This shader executes for every pixel that falls inside your shape’s boundaries.</p><p><strong>Key Concepts: Attributes and Uniforms</strong></p><p>Before we dive into code, let us clarify three important terms:</p><ul><li><strong>GPU Buffer</strong>: A memory region on the GPU that stores vertex data (positions, colors, normals, etc.). Buffers allow efficient transfer of large amounts of data from CPU to GPU for rendering.</li><li><strong>Attributes</strong>: These specify how to extract data from GPU buffers and feed it to your vertex shader. Think of them as per-vertex data.</li><li><strong>Uniforms</strong>: Global variables that remain constant across all shader executions for a single draw call. Perfect for things like transformation matrices or colors.</li></ul><p><strong>Step 1: Setting Up the HTML Canvas</strong></p><p>Let us start with a clean HTML template that includes our canvas element and basic styling:</p><pre>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;title&gt;WebGL Canvas&lt;/title&gt;<br>    &lt;style&gt;<br>        body {<br>            margin: 0;<br>            padding: 0;<br>            display: flex;<br>            justify-content: center;<br>            align-items: center;<br>            min-height: 100vh;<br>            background-color: #f0f0f0;<br>        }<br>        canvas {<br>            border: 1px solid #333;<br>            background-color: white;<br>        }<br>    &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;canvas id=&quot;canvas&quot; width=&quot;800&quot; height=&quot;600&quot;&gt;&lt;/canvas&gt;<br>    &lt;script src=&quot;script.js&quot;&gt;&lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p><strong>Step 2: Writing the WebGL JavaScript Code</strong></p><p>Now for the exciting part — our JavaScript code that brings everything to life. I have added detailed comments to explain each step of the process.</p><pre>// Get the canvas and WebGL context<br>const canvas = document.getElementById(&#39;canvas&#39;);<br>const gl = canvas.getContext(&#39;webgl&#39;);<br><br>if (!gl) {<br>    console.error(&#39;WebGL not supported&#39;);<br>    alert(&#39;WebGL not supported in this browser&#39;);<br>}<br><br>// Vertex shader program<br>const vertexShaderSource = `<br>    attribute vec4 a_position;<br>    void main() {<br>        gl_Position = a_position;<br>    }<br>`;<br><br>// Fragment shader program<br>const fragmentShaderSource = `<br>    precision mediump float;<br>    void main() {<br>        gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); // Red color<br>    }<br>`;<br><br>// Function to create and compile a shader<br>function createShader(gl, type, source) {<br>    const shader = gl.createShader(type);<br>    gl.shaderSource(shader, source);<br>    gl.compileShader(shader);<br>    <br>    const success = gl.getShaderParameter(shader, gl.COMPILE_STATUS);<br>    if (success) {<br>        return shader;<br>    }<br>    <br>    console.error(gl.getShaderInfoLog(shader));<br>    gl.deleteShader(shader);<br>}<br><br>// Function to create a program from shaders<br>function createProgram(gl, vertexShader, fragmentShader) {<br>    const program = gl.createProgram();<br>    gl.attachShader(program, vertexShader);<br>    gl.attachShader(program, fragmentShader);<br>    gl.linkProgram(program);<br>    <br>    const success = gl.getProgramParameter(program, gl.LINK_STATUS);<br>    if (success) {<br>        return program;<br>    }<br>    <br>    console.error(gl.getProgramInfoLog(program));<br>    gl.deleteProgram(program);<br>}<br><br>// Create shaders<br>const vertexShader = createShader(gl, gl.VERTEX_SHADER, vertexShaderSource);<br>const fragmentShader = createShader(gl, gl.FRAGMENT_SHADER, fragmentShaderSource);<br><br>// Create program<br>const program = createProgram(gl, vertexShader, fragmentShader);<br><br>// Look up attribute location<br>const positionAttributeLocation = gl.getAttribLocation(program, &#39;a_position&#39;);<br><br>// Create a buffer for the triangle&#39;s positions<br>const positionBuffer = gl.createBuffer();<br>gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);<br><br>// Triangle vertices: (0, 0), (0, 0.6), (0.6, 0)<br>const positions = [<br>    0.0, 0.0,<br>    0.0, 0.6,<br>    0.6, 0.0<br>];<br><br>gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW);<br><br>// Clear the canvas<br>gl.clearColor(0, 0, 0, 0);<br>gl.clear(gl.COLOR_BUFFER_BIT);<br><br>// Use the program<br>gl.useProgram(program);<br><br>// Enable the attribute<br>gl.enableVertexAttribArray(positionAttributeLocation);<br><br>// Bind the position buffer<br>gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);<br><br>// Tell the attribute how to get data out of positionBuffer<br>const size = 2;          // 2 components per iteration<br>const type = gl.FLOAT;   // the data is 32bit floats<br>const normalise = false; // don&#39;t normalise the data<br>const stride = 0;        // 0 = move forward size * sizeof(type) each iteration<br>const offset = 0;        // start at the beginning of the buffer<br>gl.vertexAttribPointer(positionAttributeLocation, size, type, normalise, stride, offset);<br><br>// Draw the triangle<br>const primitiveType = gl.TRIANGLES;<br>const drawOffset = 0;<br>const count = 3;<br>gl.drawArrays(primitiveType, drawOffset, count);</pre><p><strong>The Result</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PKQZSNRJwx-lm5ZfYSbydQ.png" /><figcaption>Screenshot of the output</figcaption></figure><p><strong>What is Next?</strong></p><p>In the next article, we will integrate WebAssembly and Rust into this setup, allowing us to leverage Rust’s performance and type safety while maintaining the browser’s graphics capabilities.</p><p><em>*Building a technical video editor using web technologies? I am documenting my journey. Follow along for more insights into WebGL, Rust, and WebAssembly integration.*</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3868a2af9f2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Motion from Scratch: My Journey into Technical Video Animations]]></title>
            <link>https://dodziraynard.medium.com/building-motion-from-scratch-my-journey-into-technical-video-animations-40689643a1a4?source=rss-2033a036a926------2</link>
            <guid isPermaLink="false">https://medium.com/p/40689643a1a4</guid>
            <category><![CDATA[computer-graphics]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[manim]]></category>
            <category><![CDATA[rendering]]></category>
            <category><![CDATA[motion-graphics]]></category>
            <dc:creator><![CDATA[RAYNARD DODZI]]></dc:creator>
            <pubDate>Sun, 07 Dec 2025 00:49:08 GMT</pubDate>
            <atom:updated>2025-12-07T00:49:08.029Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>TL;DR:</strong></p><p>I’m building a browser-based motion graphics editor inspired by 3Blue1Brown, Manim, and Figma. Existing tools felt slow, so I’m exploring Rust + WebGL2 to create an instant-preview, infinite-canvas editor and documenting the journey as I learn.</p><p><strong>Why Technical Video Animations?</strong></p><p>I’ve always been fascinated by motion graphics, particularly the math videos by <a href="https://www.youtube.com/@3blue1brown">3Blue1Brown</a>. Their ability to make complex concepts engaging inspired me to explore how technical stories and product demos could be communicated visually. At the time, I needed similar content for my own projects.</p><p>I experimented with Adobe After Effects and Illustrator, but juggling multiple applications was frustrating. In one 3Blue1Brown video, Grant Sanderson mentioned <a href="https://www.manim.community/">Manim</a>, a Python library he created for programmatically creating animations for his YouTube videos. Installation was cumbersome due to LaTeX <a href="https://docs.manim.community/en/stable/installation.html">dependencies</a> and storage needs, and the workflow was slow, creating a delayed feedback loop.</p><p>Inspired by Figma’s web design editor and my passion for graphics, I decided to explore creating a browser-based motion graphics editor with an infinite canvas and instant previews, aiming for an interactive, iterative workflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/0*Pbb00Fvq-W83j7Ue" /><figcaption>Image Generated using Grok</figcaption></figure><p><strong>Choosing the Right Technologies</strong></p><p>To understand modern web-based creative tools like Figma, Canva, Kittl, and Spline, I researched their tech stacks. This led me to <a href="https://threejs.org/">Three.js</a>, <a href="https://pixijs.com/">PixiJS</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGPU_API">WebGPU</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext">WebGL</a>, and <a href="https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D">Canvas 2D API</a>. Three.js and PixiJS build on WebGL/WebGPU. Figma started with WebGL; Spline uses Three.js for 3D rendering.</p><p>Three.js is optimized for 3D, explaining Spline’s choice. Based on blogs and sample projects, I concluded WebGL/WebGPU was the best fit. I chose WebGL2 for broad browser support, though WebGPU is appealing for future projects.</p><p>Since WebGL2 is a JavaScript API, I initially considered JS/TS. However, the geometric computation involved in computer graphics required a compiled language with tighter memory control and less GC overhead. While Figma uses C++, I chose Rust for better developer experience. With these decisions, I began building a the foundation of web-based motion graphics editor using Rust and WebGL2, inspired by Manim and Figma.</p><p>I also drew inspiration from Figma’s engineering blog posts. At this point, I was starting the journey without prior experience in WebGL or Rust, though I am comfortable with C++.</p><p><em>In my next article, I’ll write about learning WebGL, starting from </em><a href="http://webglfundamentals.com/"><em>webglfundamentals.com</em></a><em> and setting up Rust for the browser using WASM.</em></p><p><strong>Conclusion</strong></p><p>This post outlines my ongoing exploration of building a web motion graphics editor. In upcoming posts, I will continue documenting my learning process with WebGL and Rust, experimenting with combining these technologies to gradually develop a functional editor.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40689643a1a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>