Knotwork Program
Page 1: Days 1 to 3
All images on this page © copyright T. Shermer. All rights reserved.
Day 3: 30 Oct 2001
Day3a5
Working on building traditional Celtic patterns. Most Celtic pattern books I've seen recommend designing on a grid that is 45-degrees rotated from the grid that I'm using. The pattern here was hand-coded; I'm hoping to write something more efficient for specifying these beasts. This also exercises my code for extracting a diagonal strip from the grid. The top image is the final image; it was produced by rotating the program's output (lower image) in Photoshop, and then cropping. I'm getting aliasing from the image rotation, but the program is fast enough that I can make big honkin' images, so I could easily pump up the resolution to where the rotation would look fine..
Day3a4
Another SubstanceAngular picture. Here I've adjusted a parameter so that, in cells with a curved thread, the thread proceeds straight in for a distance before turning. This creates tighter curves. This picture also shows the vector gradient capability--the red-to-white gradient on the threads is at an angle.
Day3a2 and Day3a3
These pictures are made with SubstanceAngular, a new substance
I wrote today. SubstanceAngular makes angular turns rather than circular ones.
Day3a2 shows SubstanceAngular with a DiagonalWidthMultiplier of 1 (the default);
this makes the diagonal and the vertical&horizontal threads have the same
width. Day3a3 has a DiagonalWidthMultiplier of .707 (i.e., 1/sqrt(2)); this
makes the diagonal passages straight at the expense of having them a different
width than the vertical ones.
SubstanceAngular was *much* trickier to write than I had expected; for it to
look right, the Substance drawing the inner part of the strands (blue-purple
in these pictures) has to know about the width of the outer part of the strands
(black). This made the architecture a little problematic. Actually, it points
out that "SubstanceDouble" isn't necessarily as jiffy of an idea as
I first thought.
Day3a1
I fixed the radius problem with SubstanceBasic. This picture also shows a horizontal gradient (the code can produce a gradient in an arbitrary direction). I also used the new substance SubstanceDouble to create the strands here. I had a substance called SubstanceBasic2, which owned two SubstanceBasic objects, and called one after the other (that's how I got strands with a white outline around the blue). SubstanceDouble does the same thing, but with two arbitrary substances. Here, the substance used to render is a SubstanceDouble, with pointers to two substances: one a SubstanceBasic, and the other another SubstanceDouble; that's how I got the three-color strand. Having SubstanceDouble will enable me to get these two- and three- toned lines without having to write a special SubstanceBlah2 for each SubstanceBlah I design. This picture also shows a different cell size than the previous pictures, but that's been a feature since the beginning. The curves on this picture are aliasing pretty bad; I can combat that by rendering bigger and having Photoshop scale it down.
Day 2: 29 Oct 2001
Day2a2
This image is nice, but it points out a problem with SubstanceBasic--the straights and the curves don't align properly. This will have to be fixed. But also, perhaps there should be a Substance that has different thicknesses for curves than for straights, so I can get this effect if I ever want it. (A substance is an object that I use to control the appearance of a thread. It is responsible for making the rendering of the thread, one small part (snippet) at a time.)
Day2a1
This image shows off my new pixel-shaders; the strands are now shaded with a gradient rather than a flat color. The internals have been changed so that even the background gradient is produced by a simple fill with a pixel-shader. The strands here have greater width than the day-1 shader, but that's not new: Specifiable strand width has been in the code since, well, day 1.
Day 1: 28 Oct 2001
Day1
This image is a sample of what my program will produce currently, after one day's work on it. (That's not a full working-day day's work, but rather a few hours in the evening day's work.)
|
|||