Giter Site home page Giter Site logo

glavin001 / physics-based-animation Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 228 KB

Physics-Based Animation for CSCI 4471 Computer Graphics

Home Page: https://github.com/Glavin001/physics-based-animation/blob/master/assignment-physics-based-animation.pdf

License: MIT License

Processing 100.00%

physics-based-animation's Introduction

Physics-Based Animation

Physics-Based Animation assignment for CSCI 4471 Computer Graphics


Author

  • Glavin Wiechert

Features

[✓] 1. Particle Simulation

Create a Particle class or structure that keeps track of (at least) position and velocity for each particle, as well as lifespan. Initial velocities should be easy to modify. It is recommended that you should be able to draw particles in two modes: either as circles (with a radius), or as points. Use your particle class to create simulations that demonstrate the following features:

  • [✓] Collisions with wall

There are various ways to simulate collisions, e.g. directly modifying the velocity on one hand, and applying the appropriate forces on the other hand. Can you implement and compare these two approaches? Discuss the differences.

  • [✓] Inter-particle collisions

As above, indicate how you are implementing the collisions. Are they elastic or in- elastic? How would you modify your approach if some of the particles were to have a different mass than others?

  • [✓] Attractor

Create a particle which attracts other particles. Note that you can make some particles be "magnetic" (ie. attracted to it) and others unaffected by it. This can allow you to have multiple clouds, corresponding to a unique cloud for each magnet. At least one of your attractors should be moving. Indicate whether you are using a force proportional to inverse distance squared or otherwise.

  • [✓] Viscous medium

Add a drag parameter, ie. a force for each particle that is proportional and opposite to its velocity.

  • [✓] Repellor

Create a particle that repels other particles, i.e. pushes them away. Place a few such particles in a scene with hundreds (or thousands) of particles which are being “blown” in some direction (eg. via a global force). The repel force should get stronger as the particles approach each other. Add some walls to the scene to create various turbulent effects. How does this look when the particles leave traces?

Screenshots

1. Wall & Inter-particle collisions + Viscous Mediums

viscous medium and collisions

2. Wall & Particle Collisions + Viscous Mediums + Moving Attractor & Repellor

Top red particle is moving attactor. Bottom red particle is moving repellor.

particle_system

[✓] 2. Mass-spring Simulation

  • [✓] 2.1 Step 1: One pair (2 particles, 1 dampened spring)

Begin with a single pair of particles joined by a spring. The system should oscillate indefinitely when undampened, and should come to rest when dampening is turned on.

  • [✓] 2.2 Step 2: One pair plus collisions plus gravity.

Add walls and gravity to your system from Step 1. This means that it should bounce when it hits the floor, and eventually come to rest on the floor if dampened, regardless of initial position.

  • [✓] 2.3 Step 3: Mesh.

Create several meshes of particles, with adjacent particles connected by springs. Start with a narrow mesh (e.g. 3x2). Allow the meshes to drop on the floor and get squished. Try a non-rectangular mesh (e.g. a wheel with a point in the middle).

  • 2.4 Step 4: Actively-controlled mesh.

Create a mesh in which the rest lengths of the springs varies with time. Are you able to create a mesh that crawls? (You will need to implement a friction model to do so).

Screenshot

3x2 Particle Spring Mesh with extra springs for support

mesh

physics-based-animation's People

Contributors

glavin001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

b-rich

physics-based-animation's Issues

One pair (2 particles, 1 dampened spring)

2.1 Step 1: One pair (2 particles, 1 dampened spring).
Begin with a single pair of particles joined by a spring. The system should oscillate indefinitely when undampened, and should come to rest when dampening is turned on.

One pair plus collisions plus gravity

2.2 Step 2: One pair plus collisions plus gravity.
Add walls and gravity to your system from Step 1. This means that it should bounce when it hits the floor, and eventually come to rest on the floor if dampened, regardless of initial position.

Inter-particle collisions

Questions:

  • indicate how you are implementing the collisions
    • are they elastic or inelastic?
  • how would you modify approach if some of the particles were to have a different mass than others?

Answers:

Collisions are elastic -- conserve energy. There is however drag applied to air (general movement of particle) and drag for viscous mediums ( #4 ).
Larger mass particles have more momentum (F=m*a) so a larger particle colliding with a smaller particle would push the smaller particle.

Mesh

2.3 Step 3: Mesh.
Create several meshes of particles, with adjacent particles connected by springs. Start with a narrow mesh (e.g. 3x2). Allow the meshes to drop on the floor and get squished. Try a non-rectangular mesh (e.g. a wheel with a point in the middle).

Actively-controlled mesh

2.4 Step 4: Actively-controlled mesh.
Create a mesh in which the rest lengths of the springs varies with time. Are you able to create a mesh that crawls? (You will need to implement a friction model to do so).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.