Prescribed Elastic Deformation Clip

Contents Previous Next

Install

npm install -g @lmctl-ai/lmctl

lmvideo 0.1.38 is released. Source examples are pinned to public commit aab2677.

Download lmvideo 0.1.38

1280x720 30fps 90-frame original prescribed elastic mesh-state deformation clip with deterministic bounded geometry changes, floor shadow and explicit no-physics-solver wording.

Verified acceptance capture, reproducible with the lmvideo 0.1.38 prerelease runtime.

Run this example

lmctl autorun https://raw.githubusercontent.com/lmctl-ai/lmvideo/aab2677a4b6264ae6afae8ad64a1d7c1dcd3a052/examples/showcase/bench-30-prescribed-fracture.lms

Source

# B30 / G.14: deterministic authored mesh-state clip; this is prescribed motion, not a physics solver.
mkdir("build");mkdir("build/bench-30-frames"); program=_lmcode_ cli="lmvideo" install="github:lmctl-ai/lmvideo@v0.1.38";
video.size(1280,720);video.fps(30);video.frames(90);video.crf(20);video.output("build/bench-30-prescribed-fracture.mp4");video.begin();
let scene=scene3d().threads(4).background("#0b1320").ambient(0.08).tonemap("aces",1.0);scene.camera(camera3d().look_at(2.7,1.9,4.2,0.0,0.8,0.0).perspective(42.0,0.1,30.0));scene.directional_light(2.0,4.0,3.0,"#fff4d6",1.8);scene.shadows(1024,0.0015,0.008,1);
let base=mesh_lathe("0,0,0,0.34,0.228,0,0.58,0.457,0,0.7,0.685,0,0.7,0.914,0,0.58,1.143,0,0.34,1.371,0,0,1.6,0",32);let state=base.copy();let node=scene.add(state,material("#b84f45",0.0,0.62));scene.add(mesh_plane(8.0,8.0),material("#293544",0.0,0.9)).position(0.0,0.0,0.0);
for(frame in range(0,video.count())){video.frame();let t=video.t();let damping=pow(2.718281828459045,-2.0*t);let ripple=0.16*damping*sin(t*6.283185307179586);let profile="";for(k in range(0,8)){let y=1.6*float(k)/7.0;let r=0.7*sin(3.141592653589793*y/1.6)*(1.0+ripple*sin(6.283185307179586*y/1.6));if(profile!=""){profile=profile+",";}profile=profile+str(r)+","+str(y)+",0.0";}state.replace(mesh_lathe(profile,32));image_assert_true(state.geometry_hash()!=base.geometry_hash()||video.index()==0);node.rotation(0.0,t*18.0,0.0);let rendered=scene.render_image(1280,720,2);canvas.clear("#0b1320");canvas.image(rendered,0.0,0.0);canvas.text("B30 prescribed elastic deformation",30.0,42.0,font(26.0),paint().color("#f0f4f8"));canvas.text("90 raster frames · damped 8-key deformation · no physics solver claim",30.0,690.0,font(18.0),paint().color("#b8c7d9"));video.save_frame("build/bench-30-frames/frame-"+str(video.index())+".png");if(video.index()==video.count()-1){let poster=canvas.snapshot();poster.save("build/bench-30-prescribed-fracture-poster.png");let overview=image_pattern(900,560,"0.03","0.05","0.08","1");overview.blend(poster.resize(900,506),"over",1.0,0,27);overview.save("build/bench-30-prescribed-fracture.png");}}
video.end();out.print("B30 prescribed elastic deformation clip | 90 frames | authored damped 8-key mesh states | no physics solver claim");
end _lmcode_
r=run_lmcode(program);assert(r.ok,(r.ok ? "" : r.message));println(json_stringify(r.result));

Raw LMScript source

An elastic-looking mesh deforming above a shadowed floor.
The animation uses prescribed mesh states rather than a physics simulation.
Video frame: an elastic-looking mesh deforming above a shadowed floor.
This frame is used as the poster for the video below.
Prescribed Elastic Deformation Clip (3.0 seconds)