17
$\begingroup$

So I'm making a 2d animation in blender, using the z space as layers, and the camera is in orthographic view.
I'm trying to morph a square plane to be a flat circle, but I have no idea how to even approach it.

$\endgroup$
  • 1
    $\begingroup$ Start with a circle, it is easier to go from a circle to a square than the other way. You can then reverse the keyframes $\endgroup$ – VRM May 11 '15 at 17:21
  • $\begingroup$ How would I go about morphing the circle to a square? $\endgroup$ – DragonHeart May 11 '15 at 17:23
12
$\begingroup$

Add a cube to your scene, enter edit mode, and delete the top and bottom faces. Select all and press Ctrl+N and check the Inside checkbox in the Tools menu.

making Cube Target

Now add a circle and add a Shrinkwrap modifier to it. Select the cube as the Target and set the mode to Project. Now press the Apply as Shape Key option.

Shape Keys

You can now go to the Object Data panel and change the influence of your new shapekey. You can also animate it by hovering and pressing I. To go from a square to a circle, sart with an influence of 1 and then animate it going to 0. You can also delete the cube mesh now, it is not needed for the animation to work.

Final Result:

enter image description here

$\endgroup$
  • 1
    $\begingroup$ This one wins for flexibility as you could make any shape as a target. $\endgroup$ – 3pointedit May 11 '15 at 22:25
20
$\begingroup$

The easiest way, in my opinion, is to use the 'Cast' modifier. Using a subdivided plane you can cast/warp an object from one shape, to another, preset shape:

enter image description here

Animating the 'Factor' allows you to switch between the original shape and the 'cast' shape.

$\endgroup$
  • 3
    $\begingroup$ Oh my gosh! These answers are amazing! Thank you guys for your quick responses, and I love your videos, Ray Mairlot, btw. $\endgroup$ – DragonHeart May 11 '15 at 18:08
  • $\begingroup$ + 1 for not applying any modifiers $\endgroup$ – GiantCowFilms May 12 '15 at 14:51
9
$\begingroup$

If all you need is a shape you can use the To Sphere tool.

Add a plane, subdivide it and press ShiftAlt S

enter image description here

To animate create a shape key for the square part and a second shape key for the circle and animate the value for the second shape key.

Shape keys are created in object mode.

enter image description here

$\endgroup$
  • $\begingroup$ And just when the hopes were highest that nobody had mentioned the old to Sphere, Well remembered. $\endgroup$ – Haunt_House Mar 9 '18 at 17:01
6
$\begingroup$

Mapping a disc to a square


Journal of Computer Graphics Techniques Vol. 5, No. 2, 2016 http://jcgt.org. Mappings between Sphere, Disc, and Square. Martin Lambers. outlines a number of disc to square, and square to disc mappings

enter image description here

One of which is the elliptical square to disc mapping

$$\begin{align} u = x\sqrt(1 - y^2/2)\\ v = y\sqrt(1 - x^2/2)\\ \end{align}$$

Test script that adds a 16 x 16 grid (basis "square" shapekey) and it's elliptical mapping as a shapekey "circle"

import bpy
import bmesh
from math import sqrt
from bpy import context
scene = context.scene
me = bpy.data.meshes.new("Squircle")
obj = bpy.data.objects.new("Squircle", me)

bm = bmesh.new()
bmesh.ops.create_grid(bm, x_segments=16, y_segments=16, size=1)
def squircle(x, y):
    u = x * sqrt(1 - y * y / 2)
    v = y * sqrt(1 - x * x / 2)
    return u, v

bm.to_mesh(me)
sk = obj.shape_key_add("Square")
ci = obj.shape_key_add("Circle")    
for v in bm.verts:
    ci.data[v.index].co.xy = squircle(*v.co.xy)
scene.objects.link(obj)

Test on all mappings. Elliptic mapping above is row 1 column 4.

enter image description here

$\endgroup$
3
$\begingroup$

Same as the answer of Ray Mairlot, but with shrinkwrap (as Cast modifier can go too far and make it like a clover). NᴏᴠɪᴄᴇIɴDɪsɢᴜɪsᴇ pointed it out, but here's a way to do it in less steps.

shrinkwrap technique with less steps

  1. New plane
  2. New circle
  3. Extrude and fill the hole of the circle.
  4. Subdivide plane by 10
  5. Add modifier Shrinkwrap to plane
  6. Set the target of the Shrinkwrap to be the circle
  7. Apply as shape key done
$\endgroup$
1
$\begingroup$

Another non destructive way of doing this is using a subdivision modifier. enter image description here

  • Add plane
  • Add a Subdivision surface Modifier
  • Switch the Subdivision algorithm from Catmull-Clark to Simple
  • Add Cast Modifier
  • Use factor to liking (1.00 means a complete circle)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.