Tutorial: Animasi Berasas Fisika

Buat animasi menakjubkan menggunakan efek pantulan, elastis, dan gravitasi dengan urutan bingkai kunci.

**Waktu: 15 menit Difficulty: Lanjutan

Apa yang Akan Anda Ciptakan

Judul dramatis terungkap dengan animasi teks berbasis fisika, elemen orbital, dan gerakan kamera halus.

Animasi judul berbasis
Physics dengan pantulan dan efek elastis

Fitur - Fitur yang Tertutup

  • Bounce easing — Efek ball-drop dengan fisika realistis
  • ******* Elastis easing*** — Animasi overshooting seperti musim semi
  • ***** **** *** — Tepat waktu koreografi multi-elemen
  • **** Hubungan orbit* — Unsur - unsur yang mengorbit di suatu titik pusat
  • *Camera animasi — Perbesaran halus dan efek pan

Langkah 1: Pasang Kanvas

  1. Penyunting Open PinePaper
  2. Set ukuran kanvas ke YouTube thumbnail (1280×720)
  3. Set warna latar belakang ke #0a0a0a (dekat hitam)

Langkah 2: Ciptakan Judul Utama

  1. Tekan T untuk Alat Teks
  2. Klik kanvas tengah, jenis: PHYSICS
  3. Panel Properti:
    • 120
    • Keluarga Font: Inter (atau apapun yang berani sans-serif)
    • Warna: #ffffff
  4. Pusat di kanvas

Langkah 3: Tambah Animasi Gravitasi Drop

Kami akan membuat judul turun dari atas dengan efek pantulan.

  1. 2008 Pilih teks judul
  2. BukaGaris Waktu Panel** (bawah)
  3. Tambahkan bingkai kunci:
Waktu Posisi Y Kelegapan Perancis
0.0s -100 (layar lepas) 0
0.3s 360 (tengah) 1 boundan

Kesetaraan Kodeks:

const title = app.create('text', {
  content: 'PHYSICS',
  x: 640, y: -100,
  fontSize: 120,
  color: '#ffffff'
});

app.addAnimation(title.data.id, [
  { time: 0, properties: { y: -100, opacity: 0 } },
  { time: 0.3, properties: { y: 360, opacity: 1 }, easing: 'bounce' }
]);

Elastis

  1. AGAMA
  2. Ukuran font: 48, warna: #60a5fa (biru)
  3. Posisi di bawah judul utama

Tambahkan animasi elastis:

Waktu Skala Kelegapan Perancis
0.4s 0 0
0.8s 1 1 elastik

Kesetaraan Kodeks:

const subtitle = app.create('text', {
  content: 'IN MOTION',
  x: 640, y: 450,
  fontSize: 48,
  color: '#60a5fa'
});

app.addAnimation(subtitle.data.id, [
  { time: 0.4, properties: { scale: 0, opacity: 0 } },
  { time: 0.8, properties: { scale: 1, opacity: 1 }, easing: 'elastic' }
]);

Langkah 5: Tambah Partikel yang Mengorbit

Ciptakan ketertarikan visual dengan elemen pengorbitan.

  1. *****, warna #fbbf24 (amber)
  2. Posisi Woin dekat pusat
  3. Tambahkan **orbit hubungan:
const particle1 = app.create('circle', {
  x: 640, y: 360,
  radius: 8,
  color: '#fbbf24'
});

// Make it orbit around the title center
app.addRelation(particle1.data.id, title.data.id, 'orbits', {
  radius: 150,
  speed: 0.5,
  direction: 'clockwise'
});
  1. Duplikasi dan membuat 2 partikel lagi dengan radii dan kecepatan yang berbeda:
    • Partikel 2: radius 120, kecepatan 0.7, warna #f472b6 (pink)
    • Partikel 3: radius 180, kecepatan 0,3, warna #34d399 (hijau)

Langkah 6: Tambahkan Pembesaran Kamera

Amunisi membuat perasaan sinematik dengan animasi kamera.

// Zoom in slightly during the reveal
app.addRelation('camera', null, 'camera_animates', {
  duration: 2,
  keyframes: [
    { time: 0, zoom: 0.9, center: [640, 360] },
    { time: 0.5, zoom: 1.1, center: [640, 360], easing: 'easeOut' },
    { time: 2, zoom: 1, center: [640, 360], easing: 'easeInOut' }
  ]
});

Melangkah ke 7: Pratinjau dan Ekspor

  1. Pers Space untuk dipratonton
  2. Laraskan waktu sesuai kebutuhan
  3. Export sebagai WebM (disarankan) atau MP4
    • 3 detik
    • Frame Rate: 60 fps (fisik lain)
    • Gelung: Ya (untuk media sosial)

Kode Lengkap kode code

Ini kode animasi penuh untuk referensi:

// Setup
app.setCanvasSize('youtube-thumbnail');
app.setBackgroundColor('#0a0a0a');

// Main title with gravity drop
const title = app.create('text', {
  content: 'PHYSICS',
  x: 640, y: -100,
  fontSize: 120,
  color: '#ffffff',
  fontFamily: 'Inter'
});

app.addAnimation(title.data.id, [
  { time: 0, properties: { y: -100, opacity: 0 } },
  { time: 0.3, properties: { y: 360, opacity: 1 }, easing: 'bounce' }
]);

// Subtitle with elastic spring
const subtitle = app.create('text', {
  content: 'IN MOTION',
  x: 640, y: 450,
  fontSize: 48,
  color: '#60a5fa'
});

app.addAnimation(subtitle.data.id, [
  { time: 0.4, properties: { scale: 0, opacity: 0 } },
  { time: 0.8, properties: { scale: 1, opacity: 1 }, easing: 'elastic' }
]);

// Orbiting particles
const colors = ['#fbbf24', '#f472b6', '#34d399'];
const orbits = [
  { radius: 150, speed: 0.5 },
  { radius: 120, speed: 0.7 },
  { radius: 180, speed: 0.3 }
];

orbits.forEach((orbit, i) => {
  const particle = app.create('circle', {
    x: 640, y: 360,
    radius: 8,
    color: colors[i]
  });

  app.addRelation(particle.data.id, title.data.id, 'orbits', {
    radius: orbit.radius,
    speed: orbit.speed,
    phase: i * (Math.PI * 2 / 3) // Spread evenly
  });
});

// Camera animation
app.addRelation('camera', null, 'camera_animates', {
  duration: 2,
  keyframes: [
    { time: 0, zoom: 0.9, center: [640, 360] },
    { time: 0.5, zoom: 1.1, center: [640, 360], easing: 'easeOut' },
    { time: 2, zoom: 1, center: [640, 360], easing: 'easeInOut' }
  ]
});

// Play with 3-second loop
app.playKeyframeTimeline(3, true);

Variasi

Pengungkapan Surat Tertagger

Use Letter Collage dengan animasi mengejutkan:

const collage = app.letterCollage.create('PHYSICS', {
  style: 'tile',
  palette: 'neon',
  fontSize: 80
});

app.letterCollage.applyStaggeredAnimation(collage.collageId, {
  effect: 'popIn',
  staggerDelay: 0.08,
  duration: 0.4,
  easing: 'elastic'
});

Animasi

Buat elemen mengikuti kurva Bezier:

const star = app.create('star', {
  x: 100, y: 360,
  radius: 20,
  color: '#fbbf24'
});

// Animate along a curved path
app.animate(star, {
  animationType: 'path',
  pathPoints: [
    [100, 360],   // Start
    [400, 200],   // Control point 1
    [800, 500],   // Control point 2
    [1180, 360]   // End
  ],
  pathSmooth: true,
  animationSpeed: 0.3
});

Tips Pro

**** **** *** — Mulailah unsur pada waktu yang sedikit berbeda (0.1-0.2s terpisah) untuk perasaan yang lebih alami.

*Combine easings — Gunakan bounce untuk pendaratan, elastic untuk penskalaan, easeOut untuk pudar.

**60fps untuk fisika — Kadar bingkai yang lebih tinggi membuat efek pantul/elastis terlihat lebih halus.


Langkah - Langkah Berikutnya

  • (/tutorials/morphing) — Mengubah bentuk menjadi satu sama lain
  • (/tutorials/map-animation) — Animasikan data geografis
  • (/features/relations) — terjun jauh ke dalam hubungan barang