220 likes | 370 Views
使用波動方程式的擬真和互動式水面模擬. 496410032 吳金龍 Advisor: Damon Shing -Min Liu. Introduction. What can fluid simulation do for us? What is the difficulty of the topic?. Objective. Real-time and visual quality Interact with users. Height Field. h.
E N D
使用波動方程式的擬真和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu
Introduction • What can fluid simulation do for us? • What is the difficulty of the topic?
Objective • Real-time and visual quality • Interact with users
Height Field h present water surface as a 2D function h(x,y) 2D array h[i,j] y x h j i
Height Field • Pros: Process from 3D to 2D reduce computational time • Cons: One location (x,y) maps to exactly one height no breaking waves
Algorithm • Use 2 arrays A[N][M] , B[N][M] of the same size • Initialize A[i][j] with arbitrary values • Initialize B[i][j] with 0 • loop forall i,j do B[i,j] += (A[i-1,j] + A[i+1,j] + A[i,j-1] + A[i,j+1])/4- A[i,j]; forall i,j do B[i,j] *= 0.99; forall i,j do A[i,j] += B[i,j]; endloop
Algorithm • It simulate the wave propagation phenomenon travel direction
Pros and Cons • Pros: 1). Simple 2). Computational time is independentof wave source • Cons: 1). Unnatural shape of wave propagation 2). Slow wave propagation demo
Governing Equation • h : height of water surface A : amplitude ω : angular velocity t : time φ : phase λ : wave length f : frequency
Algorithm • summate all sine waves • v = λ x f is a constant , and λ increases with t • Phase increases constantly to animate wave propagation
Pros and Cons • Pros: Better look of shape of wave propagation • Cons: Computational time is proportional to wave source number demo
Governing Equation h: height of water surface t: time c: velocity x: position of x direction y: position of y direction
Damping • With damping • Where k is damping factor
Finite Difference Where h is a insignificant and non-zero value
stability • How to choose ? • Courant-Friedrichs-Lewy stability condition holds which says that information must not travel more than one grid cell per time step, i.e. c t < x
Result • CPU : AMD Athlon™3500+2.2GHZ • Graphics Card: Radeon HD 3650 • RAM : 1G • About 60 fps in grid size of 360 x 360 • demo 1demo 2
END • Thanks for listening.