FormaLau commited on
Commit
720f857
·
1 Parent(s): 34066d2

Use close continuous camera for simulator recording

Browse files
Files changed (1) hide show
  1. app/record-sim.mjs +6 -8
app/record-sim.mjs CHANGED
@@ -32,14 +32,12 @@ await page.evaluate(async () => {
32
  await new Promise((resolve) => {
33
  const frame = (now) => {
34
  const t = (now - start) / 1000;
35
- let x = 0, y = 0.82, z = 2.8;
36
- if (t < 13) {
37
- const a = t * 0.42; x = Math.sin(a) * 2.35; z = Math.cos(a) * 2.35;
38
- } else if (t < 28) {
39
- const a = (t - 13) * 0.5; x = 1.55 + Math.sin(a) * 0.35; z = 2.05 + Math.cos(a) * 0.25; y = 0.68;
40
- } else {
41
- const a = (t - 28) * 0.75; x = Math.sin(a) * 2.45; z = Math.cos(a) * 2.45; y = 0.88 + Math.sin(t * 0.5) * 0.08;
42
- }
43
  window.rl.camera.position.set(x, y, z);
44
  window.rl.controls.target.set(0, 0.23, 0);
45
  window.rl.controls.update();
 
32
  await new Promise((resolve) => {
33
  const frame = (now) => {
34
  const t = (now - start) / 1000;
35
+ // One close, continuous orbit keeps both robots large in frame and
36
+ // avoids the hard viewpoint jumps between emotion sections.
37
+ const a = t * 0.28;
38
+ const x = Math.sin(a) * 1.55;
39
+ const z = Math.cos(a) * 1.55;
40
+ const y = 0.72 + Math.sin(t * 0.22) * 0.04;
 
 
41
  window.rl.camera.position.set(x, y, z);
42
  window.rl.controls.target.set(0, 0.23, 0);
43
  window.rl.controls.update();