5
$\begingroup$

I'm trying to create some objects which are voxelated (pixelated), and break apart into voxels on collision. Like the effect achieved in the movie Pixels(2015). But I don't know how. I got this far:

1. I create a sample mesh.

2. I apply Remesh modifier with "Blocks" option.

3. I get the voxelated mesh I want.

steps 1 to 3

4. BUT, HOW DO I BREAK IT INTO THOSE VOXELS ?


What I tried

  1. I tried Cell Fracture Addon, but it creates conical shards. I want cubical shards.

  2. I tried Fracture Tools Addon, it does offer "Flat" cracks... but it does not line up with the blocks of the mesh and also each shard is containing multiple cubes. bad shards


Is there something else I can do ?

I don't know enough scripting. Can you write one ?

$\endgroup$
1

1 Answer 1

11
$\begingroup$

The Remesh modifier is made for modeling the surface only. Despite the look could appears quite similar, they are not voxels. It's probably easier to look for another workflow such as...

Particle system - Grid

From the manual:

Particles are set in a 3d grid and particles near/in the elements are kept.

The emission algorithm automatically kill the particles outside the mesh (it must be watertight for correct results). Then you can just duplicate a cube in each particle's location as shown in the picture below.

enter image description here

In order to get the cube size that allows no gap between faces you must take into account the reference object bounding box's size and the grid resolution parameter.

enter image description here

In the provided example, for a cone that stays inside a cube of 1 unit and a resolution of 100 particles, the cube size is 0.01 units.

And here's a Suzanne made of cubes splashing on the floor:

enter image description here


EDIT: ADDED BY OP

For those who can't figure out how to make those particles behave well physically:
Is there a way to make particles behave like rigid body objects?
Look at the answers by WChargin and MarcClintDion.

In a nutshell, the generated blocks are particles internally, so they will always behave like points, dimensionless. But we want the boxes to behave like real cubes, don't we? So, we extract (generate) real objects from those duplis, by doing this:
Make Duplicates Real

Now that they are independent objects, we enable Rigid Body physics on one object and copy it to all the rest by doing this:
Copy Rigid Body Settings

Done.

By the way,
If, for example, you are making them fall on a floor and letting them scatter away, some might pass through the plane, as in the OP's case. So you should increase the (floor) plane's collision margin until no cube passes through.
If it is apparent that cubes are not actually touching the floor due to increased collision margin, then you can change the plane's origin to make them look like they are really hitting the floor.
Collision Margin

$\endgroup$
5
  • $\begingroup$ Wow !! Cool, genius. :D Can you help a little more ? The particles are being treated as points, hence they are behaving stupid physically, and are having no problem getting inserted into each-other avoiding collision and geting clumped like a jelly :(. How did you made them behave like cubes ? In your GIF, the particles are full box rigid bodies and are colliding with each other and spreading out. How did you do it ? Can you provide a .blend maybe ??? $\endgroup$ Commented Feb 15, 2016 at 11:20
  • 1
    $\begingroup$ OK, I got it !! You didn't respond though. Anyway,I'll make some edits. $\endgroup$ Commented Feb 17, 2016 at 8:58
  • $\begingroup$ Glorious, good to know!! :) $\endgroup$
    – TLousky
    Commented Feb 17, 2016 at 10:33
  • $\begingroup$ Sorry @AneesAhmed777, I wanted to suggest you to write it as a separate question as it probably deserve it's own thread, but at the end I planned to write something anyway. At that point I was not sure about the best way to achieve the best result with the less passages and I left it behind. BTW I did followed almost the same workflow you have figured out yourself. $\endgroup$
    – Carlo
    Commented Feb 17, 2016 at 10:40
  • $\begingroup$ What was the rigid body settings for that monkey gif? $\endgroup$
    – J.Jesse
    Commented Nov 27, 2017 at 9:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .