June 24, 2023

sketching out the geometry

The very beginning of replacing the debug lines with proper geometry.

Now that I’m confident I’m getting data into Unreal in a consistent and performant way, I’m adding some simple geometry sketches to get started on user interaction.

The dimensions I’m pulling out of Rack are in pixels, so I spent a fair amount of time working out how to reverse Rack’s calculations and get back to the millimeters the original SVGs are required to be in (and multiplying by ten since Unreal’s unit is the centimeter), as well as adapting Rack’s top-left origin to Unreal’s center-out style. Now I know that the dimensions Unreal receives can be used as-is for two dimensions. I only have to add the third.

I won’t know the size or shape of each module’s body ahead of time, but they only need to be boxes I can paint an SVG on. Because I’ve converted the dimensions I’m sending to centimeters, which is Unreal’s base unit, what I can do is create a 1cm cube “unit module,” and scale it by the dimensions I’ve sent over to Unreal. I do the same with the other meshes and make them all 1cm on the two axes that matter.

If I’m smart about where I set each mesh’s origins, they’ll naturally sit on top of one another.

All that’s left, then, is to put it all together. I’ve already been sending over additional data for the params, like min/default/max value, and min/max angle for the knobs, so I go ahead and rotate the knobs based on their values as well. Cables remain simple debug lines for now, but it’s looking pretty decent!