Sense Hat Comes Alive

Remember the Raspberry Pi Sense Hat? Originally designed for a mission to the International Space Station, the board has quite a few sensors onboard as well as an 8×8 RGB LED matrix. What can you do with an 8×8 screen? You might be surprised if you use [Ethan’s] Python Sense Hat animation library. You can get the full visual effect in the video below.

The code uses an array to represent the screen, which isn’t a big deal since there are only 64 elements. Turning on a particular element to animate, say, a pong puck, isn’t hard with or without the library. Here’s some code to do it with the library:

for x in range(0,7):
 ect.cell(image,[0,x],[randint(0,255), randint(0,255), randint(0,255)],0.1)
 ect.cell(image,[0,x],e,0.1)
for x in range(7,0, -1):
 ect.cell(image,[0,x],[randint(0,255), randint(0,255), randint(0,255)],0.1)
 ect.cell(image,[0,x],e,0.1)

Each loop draws a box with a random color and then erases it before going to the next position. The second for loop makes the puck move in the opposite direction. You can probably deduce that the first argument is the screen array, the second is the position. The third argument sets the color, and the final argument sets an animation timer. Looking at the code, though, it does look like the timer blocks which is probably not going to work for some applications.

If that’s all there was, this wouldn’t be worth too much, but you can also draw triangles, circles, and squares. For example:

ect.circle(image,(4,4), 3, [randint(0,255), randint(0,255), randint(0,255)], 0.1)

We covered the Sense Hat awhile back. Of course, it does a lot more than just light up LEDs as you can see from this weather dashboard.

Continue reading “Sense Hat Comes Alive”

Neural Networks Walk Better Than Humans for Game Animation

Modern day video games have come a long way from Mario the plumber hopping across the screen. Incredibly intricate environments of games today are part of the lure for new gamers and this experience is brought to life by the characters interacting with the scene. However the illusion of the virtual world is disrupted by unnatural movements of the figures in performing actions such as turning around suddenly or climbing a hill.

To remedy the abrupt movements, [Daniel Holden et. al] recently published a paper (PDF) and a video showing a method to greatly improve the real-time character control mechanism. The proposed system uses a neural network that has been trained using a large data set of walking, jumping and other sequences on various terrains. The key is breaking down the process of bipedal movement and its cyclic behaviour into a series of sub-steps or phases. Each phase translates to a natural posture for the character while moving. The system precomputes the next-phases offline to conserve computational resources at runtime. Then considering user control, previous pose of the character(including joint positions) and terrain geometry, the consequent frame of the animation is computed. The computation is done by a regression network that calculates future position of the joints and a blending function is used for Motion Matching as described in a presentation (PDF) and video by [Simon Clavet]. Continue reading “Neural Networks Walk Better Than Humans for Game Animation”

Valentine’s Heart with Awesome Animations

January has drawn to a close, and for many of you that means: “Oh no! Less than two weeks’ time until Valentine’s day.” But for us here at Hackaday, it means heart-themed blinky projects. Hooray!

[Dmitry Grinberg] has weighed in with his version of the classic heart-shaped LED ring. It’s hard to beat the BOM on this one: just a microcontroller, five resistors, and twenty LEDs. The rest is code, and optionally putting the name of your beloved into the copper layer. Everything is there for you to download.

Continue reading “Valentine’s Heart with Awesome Animations”

3D Printing A Stop Motion Animation

How much access do you have to a 3D printer? What would you do if you had weeks of time on your hands and a couple spools of filament lying around? Perhaps you would make a two second stop-motion animation called Bears on Stairs.

An in-house development by London’s DBLG — a creative design studio — shows a smooth animation of a bear — well — climbing stairs, which at first glance appears animated. In reality, 50 printed sculptures each show an instance of the bear’s looping ascent. The entire process took four weeks of printing, sculpture trimming, and the special diligence that comes with making a stop-motion film.

Continue reading “3D Printing A Stop Motion Animation”

DIY Lego Slit-Scan 2001 Stargate

[Filmmaker IQ] has a bunch of great tutorials on the technical aspects of making movies, but this episode on copying the stargate Stanley Kubrick’s famous 2001: A Space Odyssey using Legos is a hacker’s delight.

The stargate in 2001 is that long, trippy bit where our protagonist Dave “I’m sorry Dave” Bowman gets pulled through space and time into some kind of alternate universe and is reborn as the star child. (Right, the plot got a little bit bizarre.) But the stargate sequence, along with the rest of the visual effects for the film, won them an Academy Award.

Other examples of slit scan animations you’ll recognize include the opening credits for Doctor Who and the warp-drive effect in Star Trek: TNG.

Continue reading “DIY Lego Slit-Scan 2001 Stargate”

Spliced Animations come to life on their pages

Remember those flipbooks you doodled into your history textbooks while you waited for the lunch bell? [Maric] takes the general principles of flipbooks and turns them on their head, giving our brain a whirl in the process. By splicing multiple frames into one image, he can bring animations to life onto a single page.

The technique is simple, but yields impressive results. By overlaying a pattern of vertical black bars onto his image, only a small fraction of the image is visible at any given point. The gaps in the pattern belong to a single frame from the animation. As [Maric] slides the pattern over the image, subsequent frames are revealed to our eyes, and our brain fills in the rest.

A closer look reveals more detail about the constraints imposed on these animations. In this case, the number of frames per animation loop is given by the widths in the transparency pattern. Specifically, it is the number of transparent slits that could fit, side-by-side, within an adjacent black rectangle.

The trick that makes this demonstration work so nicely is that the animated clips finish where they start, resulting in a clean, continuous illusion.

Don’t believe what you see? [Maric] has linked the pattern and images on his video so you can try them for yourself. Give them a go, and let us know what you think in the comments.

Continue reading “Spliced Animations come to life on their pages”

Rigging Your 3D Models In The Real-World

Computer animation is a task both delicate and tedious, requiring the manipulation of a computer model into a series of poses over time saved as keyframes, further refined by adjusting how the computer interpolates between each frame. You need a rig (a kind of digital skeleton) to accurately control that model, and researcher [Alec Jacobson] and his team have developed a hands-on alternative to pushing pixels around.

3D Rig with Control Curves
Control curves (the blue circles) allow for easier character manipulation.

The skeletal systems of computer animated characters consists of kinematic chains—joints that sprout from a root node out to the smallest extremity. Manipulating those joints usually requires the addition of easy-to-select control curves, which simplify the way joints rotate down the chain. Control curves do some behind-the-curtain math that allows the animator to move a character by grabbing a natural end-node, such as a hand or a foot. Lifting a character’s foot to place it on chair requires manipulating one control curve: grab foot control, move foot. Without these curves, an animator’s work is usually tripled: she has to first rotate the joint where the leg meets the hip, sticking the leg straight out, then rotate the knee back down, then rotate the ankle. A nightmare.

[Alec] and his team’s unique alternative is a system of interchangeable, 3D-printed mechanical pieces used to drive an on-screen character. The effect is that of digital puppetry, but with an eye toward precision. Their device consists of a central controller, joints, splitters, extensions, and endcaps. Joints connected to the controller appear in the 3D environment in real-time as they are assembled, and differences between the real-world rig and the model’s proportions can be adjusted in the software or through plastic extension pieces.

The plastic joints spin in all 3 directions (X,Y,Z), and record measurements via embedded Hall sensors and permanent magnets. Check out the accompanying article here (PDF) for specifics on the articulation device, then hang around after the break for a demonstration video.

Continue reading “Rigging Your 3D Models In The Real-World”