How do I map an image onto one face of a rotating cube array?

PalaconoPalacono Website User, HitFilm Beta Tester Posts: 3,442 Enthusiast

So, watch the video and I'll tell you how I did it, and what I actually wanted to do.

1. Make a cube out of 5 copies of the same plane, made the front face from a different plane - in retrospect, could probably lose a few faces for speed where they're not visible.
2. Added an image layer, made it invisible and added an Environment Map viewer to that front plane and made it use the image layer.
3. Added 16 of the Cube Composite to another Composite and made them all 3D Unrolled (as nothing else worked right)
4. Keyframed the rotations of each cube at a random time and either left/right, or up/down.
5. Added couple of random lights: one above and in front, one behind and to the side.
6. Pointed the camera at one of the cubes in the middle and keyframed two positions for it at the start and end, so it orbited around them all slightly.

This was done in Hitfilm 4 Express, BTW.

It looks OK(ish), but because the Environment Map Viewer is projecting the image onto the face, it's not rotating with it, which is what I wanted.

I'm probably using the wrong tool entirely, but with Hitfilm, you can sometimes find a happy accident that still does something interesting. :D

There is a line between all the cubes, despite them being 200x200x200 and 200 pixels apart. I guess I'll have to try and make them 199 pixels apart to overlap slightly or make them 199x199x199 so there is an actual centre pixel (odd numbered dimensions will have one) rather than it being off-centre by half a pixel.

That, I can mess about with easily enough, but is there a better way to 'project' the image into the front face of the cube surface so that it rotates with it, short of having to cut the image up and apply it to each cube individually - and therefore have 16 different cubes instead of one? Or not?


  • Triem23Triem23 Moderator Moderator, Website User, Ambassador, Imerge Beta Tester, HitFilm Beta Tester Posts: 18,262 Ambassador

    I'll put some thought into it, but I think slicing the image into squares is the best method here. But, I would set up an Image Holder Composite Shot for the full image,  then create Slice 1 comp at the correct size, drag in Image Holder and position it until you see the correct bit. Duplicate and repeat. 

    At least by doing it that way all you do is change the picture/video in Image Holder and everything updates. 

    Heck, set up a back face for a second image, and you have a transition as well. 

    That looked really cool. 

  • PalaconoPalacono Website User, HitFilm Beta Tester Posts: 3,442 Enthusiast

    @Triem23 thanks, I was wondering if it was going to be something like that (although without knowing what the details would be other than more work than I put into this test ;)). I only thought I'd see what the Environment Map Viewer did to try and avoid that and was pleasantly surprised with the result.

    I'm now hacking it about to see if I can cut into the cubes with a mask, so it could be a logo or something, but HF4E just turned its toes up and I've lost a few steps since last backup. :)

  • PalaconoPalacono Website User, HitFilm Beta Tester Posts: 3,442 Enthusiast
    edited June 2016

    Well, that test didn't quite work as well as expected, but was still fairly informative.

    I moved the cube grid into another composite with a new camera facing directly at it and then put a black plane in front of it and cut out a shape and inverted the mask.

    Then back in the composite with the moving camera you see the grid with the cutouts, and the centre rotating cubes look fine, but the edges aren't as good as I hoped, because it's only cutting into a 2D projection of the front, not actually cutting into the cubes themselves.

    But, for a front-facing version, that could then maybe have some 3D extrusion added to 'put back' the sides, and having that rotated, it might pass muster. But HF4E doesn't have Extrusion, and I'm not recreating this in HF3Pro - which does - as it was only supposed to be a quick test. I could buy the Starter Pack for HF4E, but I'm sure there's still more fun to be had randomly messing about yet. :)

Sign In or Register to comment.