A Math Based Personality For Games

We make no apologies for being hardware focused here at Hackaday, but that doesn’t mean we aren’t occasionally impressed by a particularly inspired feat of bit wrangling. For example, [t3ssel8r] has taken a break from his game to discuss his procedural animation system and the beautiful math behind it.

Sometimes, rather than having specific keyframes, games will instead use procedural animation. This means that the position is determined on the fly rather than a predetermined set of positions. Developers can use the combination of IK or FK (inverse or forward kinematics) to solve for rotation and positions of the joints that will place the end at a specific position. Particularly with crawling multi-limb things, it’s pretty easy to put a limb on the ground and keep it there until it’s too far away, pick a new spot, and move it there. It’s simple code to write and looks convincing. It can handle complex terrain and situations with different limb positions.

However, it doesn’t offer the chance to inject some life or personality into the movement as keyframes do. [t3ssel8r] goes through the equations and reasoning behind his semi-implicit Euler solver-based system. There are some fantastic explanations in the video, but the short version is that he has three parameters to control the system’s frequency, dampening, and initial response. This allows him to tweak the behavior in a somewhat intuitive manner. One problem is stability; if the timesteps get too large, the position quickly explodes outwards. Using eigenvalues (who ever thought you’d use those) to determine the minimum timestep allows the system to remain stable and take multiple smaller steps when needed or just bound the change temporarily.

If you’re looking for more animation, this blender plugin renders your PCB traces in a new light.

Continue reading “A Math Based Personality For Games”

partially finished print, with the embedded animation

Flip Book Animations On The Inside Of 3D Prints

We’ve all seen 3D printed zoetropes, and drawn flip book animations in the corner of notebooks. The shifting, fluid shape of the layers forming on a 3D printer is satisfying. And we all know the joy of hidden, nested objects.

Hackaday alumnus [Caleb Kraft] has a few art pieces that all reflect all these. He’s been making animations by recording a 3D printer. The interesting bit is that his print is made of two objects. An outer one with normal infill that gives a solid form, and a layer cake like inner one with solid infill. It’s documented in this video on YouTube.

CAD model of the stack of frames
CAD model of the stack of frames

There are lots of things to get right.  The outer object needs to print without supports. The thickness of the “layer cake” layers determines the frame rate. I had to wonder how he triggered the shutter  when the head wasn’t in the way.

His first, experimental, piece is the classic ‘bouncing ball’ animation, inside a ball, and his mature piece is Eadward Muybridge’s “The Horse, In Motion” inside a movie camera.

We’ve covered [Caleb Kraft] before, of course. His Moon On A Budget piece is wonderful.  And we’ve covered a number of 3D printer animations. and 3D zoetropes.  We particularly were drawn to this one.

Thanks [jmc] for the tip!

Continue reading “Flip Book Animations On The Inside Of 3D Prints”

Servo Larson scanner

No LEDs Required For This Servo-Controlled Larson Scanner

All things considered, it’s pretty easy to get one LED is a strip to light up sequentially, and have it bounce back and forth. Turning that simple animation into a real Larson scanner, with smooth transitions and controlled fade-out, is another thing entirely. And forgetting the LEDs altogether and making a servo-operated Larson scanner is — well, let’s just call it an interesting lesson in hardware abstraction.

The Larson scanner, named after famed TV producer Glen A. Larson for his penchant for incorporating it into shows like Battlestar Galactica and Knight Rider, is actually hard to execute in hardware thanks to the fading tail that follows the lead pixel as it dances back and forth across the display. [Eric Gunnerson] decided to make this and other animation effects easier to achieve with Fade, a custom framework for LED animations that runs on an ESP32.

LED animations are fine, but what about servos? Could Fade be modified to support them? This turned out to be a fairly easy mod thanks to Fade’s architecture and [Eric]’s existing support for non-addressable LEDs via PWM signals. And it was even possible to support more than the 16 PWM channels on an ESP32by adding a UDP connection that puts multiple ESP32s under the control of a central microcontroller.

The video below shows [Eric]’s demo of servo support, with an eight-channel electromechanical Larson scanner. Each “pixel” is a painted ping pong ball swinging back and forth on a hobby servo, and the whole thing sounds just about as awful as you’d expect it to. If you squint just right, the effect looks pretty convincing, but that’s hardly the point. The real story here is [Eric]’s thoughtful architecture, which made the mods easier than starting from scratch.

Continue reading “No LEDs Required For This Servo-Controlled Larson Scanner”

Watch Blender Plugin Make Animated PCB Traces (and More)

[Staacks]’s Blender plugin to animate growth is behind the sweet animation seen above. It’s an add-on that cleverly makes creating slick growth animations easier when using Blender. It isn’t limited to PCB images either, although they do happen to make an excellent example of the process.

The add-on isn’t limited to animating PCB traces.

The idea is that one begins with an image texture with a structure showing a bunch of paths (like a maze, or traces on a PCB), and that gets used as an input. The plugin then uses a path finding algorithm to determine how these paths could grow from an origin point, and stores the relevant data in the color channels of an output image. That output is further used within Blender as the parameters with which to generate the actual animation, resulting in the neat self-creating PCB seen above. That PCB isn’t just for show, by the way. It’s the PCB for [Staacks]’s smart doorbell project.

Blender is an amazingly comprehensive tool for modeling and animation, and while we’ve covered using it to create high-quality KiCad renders, this kind of animation is really something else.

Here is the GitHub repository for the Blender growth tool if you’re interested in giving it a spin. If you’d like to see more first, watch the video embedded below for a showcase of what it’s capable of, and how it works.

Continue reading “Watch Blender Plugin Make Animated PCB Traces (and More)”

Mastering Stop Motion Through Machine Learning

Stop motion animation is notoriously difficult to pull off well, in large part because it’s a mind-numbingly slow process. Each frame in the final video is a separate photograph, and for each one of those, the characters and props need to be moved the appropriate amount so that the final result looks smooth. You don’t even want to know how long Ben Wyatt spent working on Requiem for a Tuesday, though to be fair, it might still get done before the next Avatar.

But [Nick Bild] thinks his latest project might be able to improve on the classic technique with a dash of artificial intelligence provided by a Jetson Xavier NX. Basically, the Jetson watches the live feed from the camera, and using a hand pose detection model, waits until there’s no human hand in the frame. Once the coast is clear, it takes a shot and then goes back to waiting for the next hands-free opportunity. With the photographs being taken automatically, you’re free to focus on getting your characters moving around in a convincing way.

If it’s still not clicking for you, check out the video below. [Nick] first shows the raw unedited video, which primarily consists of him moving three LEGO figures around, and then the final product produced by his system. All the images of him fiddling with the scene have been automatically trimmed, leaving behind a short animated clip of the characters moving on their own.

Now don’t be fooled, it’s still going to take awhile. By our count, it took two solid minutes of moving around Minifigs to produce just a few seconds of animation. So while we can say its a quicker pace than with traditional stop motion production, it certainly isn’t fast.

Machine learning isn’t the only modern technology that can simplify stop motion production. We’ve seen a few examples of using 3D printed objects instead of manually-adjusted figures. It still takes a long time to print, and of course it eats up a ton of filament, but the mechanical precision of the printed scenes makes for a very clean final result.

Continue reading “Mastering Stop Motion Through Machine Learning”

Animation In Education, 1950’s Style

Back before the days of computers, animation was drawn by hand. We typically think of cartoons and animated feature films, but there were other genres as well. For example, animation was also used in educational and training films. [Javier Anderson] has tracked down a series of antenna and RF training videos from the Royal Canadian Air Force in the 1950s and 60s and posted them on his YouTube channel.

He has found three of these gems, all on the topic of antenna fundamentals: propagation, directivity, and bandwidth (the film on propagation is linked below the break). Casually searching for the names listed in the film’s credits will lead you down an endless and fascinating rabbit hole about the history of Canadian animation and the formation of the Canadian National Film Board and its Studio A group of pioneering young artists (one can easily lose a couple of hours doing said searches, so be forewarned). For these films that [Javier] located, the animator is [Kaj Pindal]. [Kaj] (1927-2019) was a Dane who learned his craft as a teenager, drawing underground anti-Hitler comics in Copenhagen until fleeing for his life. He later emigrated to Canada, where he had a successful career as an artist and educator.

Animator [Kaj Pindal] at his desk, c.2012
Anyone who has tried to really grasp the physical connection between currents flowing in an antenna wire and the resultant radiated signal described by the second-order partial differential electromagnetic wave equation, all while using only a textbook, will certainly agree — unarguably this is a topic whose teaching can be significantly improved by animations such as [Kaj]’s. And if you’d like to sprinkle more phrases like “… in time-phase and space-quadrature …” into your conversations, then this film series is definitely for you.

Have you encountered any particularly helpful or well-made animated educational videos in your education and/or career? Are there any examples of similar but modern films made using computer generated images? Thanks to reader [Michael Murillo] for tipping us off to these old films.

Continue reading “Animation In Education, 1950’s Style”

Art With Technology Hack Chat

Join us on Wednesday, June 16 at noon Pacific for the Art with Technology Hack Chat with Cory Collins!

As hackers, we naturally see the beauty of technology. We often talk in terms of the aesthetics of a particular hack, or the elegance of one solution over another, and we can marvel at the craftsmanship involved in everything from a well-designed PCB to a particularly clever reverse-engineering effort. Actually using technology to create art is something that’s often harder for us to appreciate, though, and looking at technological art from the artist’s side can be pretty instructive.

Cory Collins is an animator and artist with a long history of not only putting tech to work to create art, but also using it as the subject of his pieces. Cory’s work has brought life to video games, movies, and TV shows for years; more recently, he has turned his animation skills to developing interactive educational material for medical training. He has worked in just about every physical and digital medium imaginable, and the characters and scenes he has created are sometimes whimsical, sometimes terrifying, but always engaging.

Cory will stop by the Hack Chat to talk about what he has learned about technology from the artist’s perspective. Join us as we dive into the creative process, look at how art influences technology and vice versa, and learn how artistic considerations can help us address the technical problems every project eventually faces.

join-hack-chatOur Hack Chats are live community events in the Hackaday.io Hack Chat group messaging. This week we’ll be sitting down on Wednesday, June 16 at 12:00 PM Pacific time. If time zones have you tied up, we have a handy time zone converter.

Click that speech bubble to the right, and you’ll be taken directly to the Hack Chat group on Hackaday.io. You don’t have to wait until Wednesday; join whenever you want and you can see what the community is talking about.