Parallax and 3D from a picture
Give a picture depth. A landscape becomes a Rive parallax scene whose layers move like a camera passing through it, or a Spline 3D diorama you can orbit. A character picture becomes a rounded 3D figure that turns, and walk frames a 3D walk.
- You bring
- A picture: a landscape or scene, or a character. For a walk, its frames.
- You get
- A
.rivparallax scene, or a Spline.splinecodescene or figure for the web. - Needs
- The npm install.
Ask your assistant
- Turn
forest.pnginto a parallax scene for my website header that looks toward the mouse. - Make this landscape a 3D scene in Spline with a slow orbit around the cabin.
- Make my mascot (
mascot.png) a 3D figure that sways to show its depth. - Build a low-poly 3D desk with a lamp and a mug in Spline.
A scene from a picture
scene_layersshows the picture with a ruler. Your assistant boxes each thing that should stand out in depth (a character, a tree, a rock) and finds the row where the ground meets the far scenery. It cuts each object out by its colours and shows the cut. A cut that took too much, such as sky or a drawn shadow, is fixed with one point outside it.- Then either:
image_to_parallax_riv: a Rive file whose layers move as a camera moving through the scene would move them, far layers a little and near ones more, with the ground sliding row by row. It drifts side to side, pushes in and back, or looks toward the pointer through two inputs your page sets.image_to_3d_scene: a Spline scene. The ground becomes a floor receding into the distance, the far scenery a backdrop, and each object a rounded body standing where it meets the floor. A slow camera move shows the depth: an orbit, a push in, or a drift.
From the front, both look exactly like the picture. What was hidden behind each object is filled in from around it.
A 3D figure from a character picture
image_to_3d_figureinflates the character into a rounded, solid figure, and can animate it, for example a sway that shows its depth.- For limbs that stand apart when it turns:
figure_regionsnumbers the picture's parts, and the pieces drawn over the body (a near arm) and behind it (a far leg, a tail) are built in layers. image_frames_to_3d_walkturns walk frames into a 3D walk with a gentle turn, baked into the file.
A 3D scene from a description
generate_spline_scene builds a Spline scene from shapes, materials, lights and a camera, with hover and press interactions: a .splinecode for the web, or a .spline that opens in the Spline editor. For painted models in it, see Paint a blocked-out scene.
Good to know
- Colours are written so Spline shows the picture's own colours. Spline displays its canvas in a wider colour space, which would otherwise make every colour look stronger.
- The 3D is built from the picture's outlines, so it is rounded rather than modelled: good for depth and motion, not for close inspection from the side.
- 3D models from Blender and other apps convert straight to Spline: Convert other formats.