RealFlow在線教程翻譯(5)——Shattered Glass (破碎的玻璃杯)

(以下英文部分及圖片皆來源於RealFlow官方文檔:http://support.nextlimit.com/display/rf2014docs/Your+First+Project)


    One of the most famous RealFlow scenes is a shattering glass after being hit by a bullet. The idea behind this setup is very interesting, because it is a combination of fluids, rigid bodies, and slow motion effects. In this tutorial you will learn how to recreate this simulation with RealFlow's built-in tools. Please note that this simulation is split into two parts: in the first simulation a resting and calm fluid is created. Then, the interaction between the fluid and the smashing glass is done in a separate action.

     RF的一個著名場景是玻璃杯被子彈擊中破碎。相關設置背後的想法非常有趣,因爲該場景是流體、剛體與慢運動效果的組合。在本教程中,你將學到如何使用RF的內置工具來創建該仿真。請注意該仿真被分成兩個部分:首先創建一個靜止的fliud,然後單獨創建該fliud與打碎的玻璃杯的相互作用。

The result of the workshop rendered with Maxwell Render.

使用Maxwell渲染的結果

 

Here is the nodes list for the first part – the relaxed fluid:(第一部分的節點列表 — 靜止液體:)

  • 1 glass object(玻璃杯對象)

  • 1 “Gravity” daemon(重力場)

  • 1 “k Volume” daemon(體積控制場)

  • 1 “k Speed” daemon(速度控制場)

  • 1 “Drag Force” daemon(阻力場)

 

All scene elements can be added from RealFlow's “Edit” menu:

  • Add > Objects | Emitters | Daemons

  • RealFlow nodes can be moved, scaled, and rotated with the W, R, and E keys.

  • Imported objects from SD files have to be unlocked before they can be transformed with Selected object > Node Params > Node > SD ↔ Curve

  • Viewport perspective is changed with the 1, 2, 3, and 4 keys.

  • Shading modes are toggled with the 7, 8, 9, and 0 keys.

The Setup – Glass Filling(設置—填充玻璃杯)

    For this scene, the milk glass from the “Wetmap Creation” quick start tutorial is used. Please bear in mind that this tutorial is based on RealFlow's standard scale, and therefore the objects might appear rather big. The very first task is to fill the glass with milk:

    本場景使用Wetmap Creation快速使用指南中的牛奶杯。請注意該指南基於RF的基準尺寸,所以對象看起來可能很大。首要任務是先將杯子填滿。

  • Import the glass with the Ctrl/Cmd + I command.

  • 使用Ctrl/Cmd + I導入杯子
  • If you want to reposition it unlock it under Node Params > Node > SD ↔ Curve.

  • 如果想移動它,在Node Params > Node > SD ↔ Curve 下解除鎖定
  • With the M key the object can be moved.

  • 使用M鍵移動對象
  • Add “Circle” emitter from Edit > Add > Particle Emitter and place it inside the glass. It can be moved with the M key as well. If you have to rescale the emitter use the R key.

  • 添加Circle發射器,並將其置於杯子內。同樣可以使用M鍵移動,使用R鍵縮放。
  • To get more particles, the emitter's “Resolution” value has to be increased under Node Params > Particles. The value depends on the size of the glass object and the scene's scale. For the fluid in the rendered image, a value of 30 has been used.

  • 爲增加粒子數量,在Node Params > Particles下調整增加發射器的 Resolution 值。該值取決於杯子尺寸與場景尺寸。在上面的渲染圖中該值爲30。
  • Other settings are: Int Pressure = 0.5, Viscosity = 4.0, Surface Tension = 10

  • 其他設置爲:Int Pressure = 0.5, Viscosity = 4.0, Surface Tension = 10
  • Under “Circle”, set “V/H random” to 1.0 each.

  • 將Circle子菜單中的V/H random值設爲1.0

 

 

A very important thing to check is the glass object's “Liquid - Particle Interaction” panel:

一件非常重要的事是查看杯子對象的Liquid - Particle Interaction面板:

  • Change “Collision distance” to 0.01. This will bring the fluid particles closer to the object's surface.

  • 將Collision distance(碰撞距離)值設爲0.01。這將使液體粒子更接近杯子對象表面。

 

Finally, some daemons are necessary:

  • Edit > Add > Daemons > Gravity | k Volume

  • k_Volume01 > Node Params > k Volume > Fit to object > select glass node

 

Now, the scene can be simulated:

現在可以對場景進行仿真了:

  • Click on the small lock icon to left of the timeline. With this action, RealFlow neither counts frames (no matter how long you simulate, the timeline slider will remain at 0), nor writes out any files. This mode is perfectly suited to fill the glass.

  • 點擊時間軸左側的小鎖圖標。該操作使RF不計算幀數(無論仿真運行多長時間,時間軸都停留在第0幀處),也不寫入任何文件。該模式特別適合用來填充杯子。
  • Simulate.

 

 

If you think that the glass is properly filled (between one half and two thirds) stop the emission of particles:

如果覺得杯子填充得差不多了(在1/2至2/3之間)停止粒子發射:

  • Stop the simulation with another click on “Simulate”.

  • 再次單擊Simulate停止仿真。
  • Highlight the “Circle01” and go to Node Params > Particles > Max Particles.

  • 高亮Circle01,轉到Node Params > Particles > Max Particles
  • Also open the “Statistics” panel and look for “Existent Particles”.

  • 打開Statistics(統計)面板,尋找Existent Particles(現存粒子)
  • Let's say the value there is around 110,000. Under “Max particles” you enter 125,000 (or any other value greater than 110,000), and resume the simulation.

  • 這裏現存粒子數(Existent Particles)大約是110000,少於最大粒子數(Max particles)125000,仿真繼續。
  • The emission will stop automatically when the “Max Particles” limit has been reached.

  • 當Max Particles(最大粒子數)限制達到時粒子發射將自動停止
  • Let the simulation run for a few more minutes.

  • 讓仿真再運行幾分鐘。

 

Relaxing the Fluid(使液體靜止)

In the next step you create a calm fluid surface:

下一步創建靜止液體表面:

  • Unlock the simulation with another click on the lock icon.
  • 再次點擊lock圖標解鎖,繼續仿真
  • If the emitter is not selected, click on it again.
  • 如果沒有選擇發射器,再次點擊它
  • Node Params > Initial State > Use Initial State > Yes(使用初始狀態)
  • Make Initial State
  • 創建初始狀態




  • Click on the small triangle next to the “Reset” button and enable “Reset To Initial State”.(重置到初始狀態)
  • Reset(重置)

 

 

For the relaxation process, two more nodes are required:

靜止過程需要另外兩個(關鍵控制幀)節點:

  • Add a “k Speed” daemon.(添加速度控制場)

  • Node Params > k Speed > Limit & Keep > Yes(限制速度)

  • Max speed > 1.0

  • Max speed > right-click > Add key(添加關鍵幀)

  • Shift the timeline slider to frame 200 (the fluid disappears).(將時間軸調至200幀)

  • Max speed > 0.01

  • Max speed > right-click > Add key(添加關鍵幀)

  • Reset (the fluid reappears).(重置,液體重現)

  • Add a “Drag Force” daemon.(添加阻力場)

  • Under Drag Force > Drag Strength create two keys with values of 0 (f = 0) and 75 (f = 200).(在第0幀與第200幀處分別設置阻力強度爲0與75,作爲關鍵控制幀)

  • Simulate. At frame 200 the fluid should be calm and relaxed.(開始仿真,200幀處液體應靜止)

  • Create a new initial state for your final simulation as described above.(按上述操作,爲最終仿真創建一個新的初始狀態)

  • Reset.(重置)

 

The fluid's relaxed state.

液體靜止狀態

The Setup – Glass Shattering(杯子參數設置)

  • Remove the “k Speed” and “Drag Force” daemons.(移除速度控制場與阻力場)

  • Click on the small triangle next to the “Simulate” button and open “Options...”.(點擊Simulate旁的小三角打開設置)

  • Under General > FPS Output enter 72, 75, or 90 (according to your film/TV system).(根據系統實際情況,設置每秒輸出幀數)

  • Add a “Sphere” node – this object will serve as a bullet. In the viewport's “Front” mode (2) shift the bullet to the right.(插入一個球形節點作爲子彈)

  • Add a “Cube” node, position it beneath the glass, and rescale it. Make it big, because it is the ground object.(插入一個立方體節點於杯子之下並放大作爲地面)

  • Add a “Cone” node and rescale/reposition/rotate it until you get a setup similar to the image below. The “Cone01”object should be aligned with the bullet, because it is the zone of impact.(插入一個圓錐節點並調整至如下圖位置與形狀,作爲撞擊區域,該圓錐對象應該與子彈連成一線。)

 

Fragmenting the Glass(給杯子劃分網格)

The bullet should hit the glass exactly where the cone is intersecting the glass. This is also the zone with the highest density of fragments:

子彈應該擊中圓錐與杯子相交的部位,那裏也是杯子網格劃分最密的地方。

  • Select the glass node.(選擇杯子節點)

  • Tools > Fracture Tool > Voronoi By Steering Geometry...(採用Voronoi算法劃分)

  • Rough number of pieces > 130 (or any other number)(確定大概劃分塊數)

  • Click on the “...” button and choose “Cone01”.(選擇圓錐)

  • Lowest/highest concentration rate > 0.007

  • Transition length > 0.2

  • OK

  • A new MultiBody with a “_fractured01” suffix appears.(出現一個帶有_fractured01後綴的新組合體)

  • If you are happy with the results “Cone01” and the original glass node can be deleted.(如果對Cone01結果滿意,可以將初始杯子節點刪除)

    The last two parameters are used to control the transition from the impact zone to the outer areas of the glass. Both settings avoid that the glass will be broken into lots of very small, almost uniform, pieces. If you are not satisfied just delete the newly created object, and repeat the fracturing process with other values.

    最後的兩個參數用於控制從撞擊區域到杯子外部區域的過渡。所有的設置應避免杯子破碎成許多非常小的,幾乎一致的碎片。如果不滿意,刪除新創建的對象,重複以上設置過程,重新設置參數即可。

 

The Rigid Body Parameters(剛體參數)

    In this step, the dynamics properties will be activated and adjusted. Let's start with the fractured glass node:

    本步驟將激活並調整動力學屬性,現在開始處理碎杯子節點:

  • Node > Dynamics > Active rigid body(節點>動力學>激活剛體)

  • Rigid body > @ object friction > 0.5(摩擦力)

  • Rigid body > @ elasticity > 0.5(彈性力)

 

    Then the ground object (“Cube01”):(地面對象)

  • Node > Dynamics > Passive rigid body(從動剛體)

 

    Finally, the bullet (“Sphere01”). This node will be animated, but has rigid body features as well:(子彈也有剛體特徵)

  • Node > Position > X (the first value from the trio)

  • Create a key-framed animation from right to left (or left to right) using the method from “Relaxing the Fluid”. The bullet should be fast to get a vivid splash: 20 m in 70-80 frames is a good value.

  • 使用“Relaxing the Fluid”中的方法創建一個關鍵幀動畫(從左至右或相反)。爲實現生動逼真的晃動,子彈的速度要快,70-80幀移動20m是較好的速度值。
  • Node > Dynamics > Passive rigid body(從動剛體)

    The combination of animation and rigid body properties is interesting, because the bullet's motion path and speed can be controlled, but it is able to interact with other rigid bodies. In this state, the bullet has infinite force.

    將動畫與剛體屬性結合起來非常有趣,因爲子彈運動路徑和速度可以控制,但是還可以與其他剛體相互作用。這裏,子彈有無限動力。

Joining the Pieces(連接碎片)

    Currently, the fractured glass will fall apart and the fluid will pour out, because the pieces are not connected. There has to be a way to reconnect them, but these joints have to break when the bullet hits the glass. The solution is MultiJoints – all panels are located under the “MultiJoint01” element's “Node Params”:

    目前,杯子碎片將四處散落液體也將灑出,因爲碎片不是相連的。需要重新連接碎片,但是當子彈擊中杯子時原來的連接已經破壞。解決方法是“MultiJoints”(多連接)。

  • Edit > Add > Objects > MultiJoint

  • Creation > Objects A > fractured glass node

  • Creation > Objects B > fractured glass node

  • Forces > Force max mode > Constant limit

  • Collisions > Enable if break > Yes

  • Break > Break if distance exceeded > Yes(如果距離超出則破壞斷開)

  • Creation > Create/Recreate

 

 

    The “Forces” panel contains a “@ Max force” parameter and adjusting this value is the most difficult part. The joints have to be strong enough to resist the glass body's own weight and the weight of the fluid. Start with a rather high value, e.g. 250,000 and trigger the simulation. Let it run for around 5-10 frames:

    Forces面板含有一個“@ Max force”參數,將該值調整合適最爲困難。連接需要足夠強以支持杯子與液體的自重。先試以較大值,如250000,進行仿真,運行約5-10幀。

  • If you can see orange or red joints then the forces are not strong enough and the links break. In this case you have to increase “@ Max force”.

  • 如果可以看到橘色或紅色結點且由於結點力不夠大以至連接破壞。這種情況應該增加 “@ Max force”值
  • Go to Statistics > @ Max force used since creation. This read-only field gives you a hint of the occurring forces, and can be used as a starting value.

  • 進入 統計>@創建以來使用的最大力。該只讀域給出當前力的提示,可以用於初始值。
  • Do not use the displayed value 1:1, but add a 10-20% buffer and transfer the value to “@ Max force”.

  • 不要直接使用顯示值,增加 10-20% 的裕度。
  • Reset and simulate again. If all joints are green and intact you can go on simulating. Otherwise you have to further increase “@ Max force”.

  • 重置並仿真。如果所有結點都爲綠色且完好則可以繼續仿真,否則需繼續增加@ Max force值。
  • For the rendered image at the beginning of this tutorial, “@ Max force” has been set to 150,000 with a “@ Max force random” value of 100.

  • 本教程開頭處的渲染圖,@ Max force爲150000,@ Max force random值爲100。

 

The Simulation and Previews(仿真和預覽)

    It is very likely that you will have to create different versions until you get the desired result – and these versions have to be compared. The easiest way to do this is to use RealFlow's preview engine:

    很可能需要嘗試多次才能得到想要的結果,並且多個版本之間需要相互比較,最簡單的方式是使用RF的預覽引擎:

  • Adjust the point of view by rotating, zooming and panning the viewport.(調整視角)

  • You can add a camera, but this step is not mandatory.(可以添加相機但不是必須的)

  • Go to frame 0, and click on Playback > OpenGL.

  • RealFlow goes through the simulation and records the viewport frame by frame.(RF進行仿真並逐幀記錄視角)

  • If the timeline slider stays at frame 0 please check if the maximum preview frame is not 0.(如果時間軸始終停在第0幀,檢查最大預覽幀數是否爲0)

  • Once the frames have been recorded, a “Movie Player” window is opened automatically. After a few seconds you can watch the simulation in real-time.

  • 一旦幀被記錄,會自動打開一個電影播放器,幾秒之後可以看到實時仿真結果。
  • Click on the player's “Save” icon, and write the movie to disk.(點擊播放器保存圖標,將movie寫到磁盤)

 


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章