1 / 22

3D Physical Simulation

3D Physical Simulation. Cao Han D-A7-2819-0 Project Supervisor: Dr. Wu Wen Faculty of Science and Technology University of Macau. Outline. Part I: construct a Newton’s cradle by a physical engine and the C++ language. Principle of physical simulation Newton’s cradle analysis

bedros
Download Presentation

3D Physical Simulation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 3D Physical Simulation Cao Han D-A7-2819-0 Project Supervisor: Dr. Wu Wen Faculty of Science and Technology University of Macau

  2. Outline • Part I: construct a Newton’s cradle by a physical engine and the C++ language. • Principle of physical simulation • Newton’s cradle analysis • Collision detection • Numerical Computation • Deformable body simulation

  3. Outline (cont.) • Part II: implement a Newton’s cradle with haptic feedback • Interaction with Newton’s cradle • Scenes Switching • Cutting Ropes • Haptic Feedback • Spring Effects • Conclusion

  4. Principle of Simulation • Problem: Given the physical environment, tofind the position of the object

  5. Newton’s cradle analysis Problem: how to compute the sumforce Drag Force Gravity Drag Force provide centripetal force Drag Force = centripetal force(1/2mv^2) + the subforce of gravity along the rope

  6. Collision Detection Problem: Detects if two balls collide If Distance < 2 * radius Collision Happen

  7. Collision Detection (cont.) Energy and Momentum keeps the conservation in the system Center line b a : the mass of body a : the mass of body b : the velocity of a before the collision : the velocity of bbefore the collision along the rope along the rope. : the velocity of a after the collision : the velocity of b after the collision along the rope along the rope

  8. Numerical Computation • The Euler Method • The Fourth-order Runge-Kutta (RK4) Method Problem: given the acceleration, calculate the position every dt time

  9. The Euler Method T=92 Ball Real motion T=198 Euler Method T=244

  10. The Fourth-order Runge-Kutta (RK4) Method T=66 Ball Real motion RK4 T=90 T=306 Euler Method

  11. Deformable Body Simulation Rope Spring Force Which indicates the force direction A particle SpringForce = - Distance * SpringConstant FrinctionForce = - Velocity * FrictionalConstant

  12. Part II: Implement a Newton’s cradle with haptic feedback • Interaction with Newton’s cradle • Handle Mirror Reflection Problem • Cutting Ropes • Haptic Feedback • Spring Effects • User Interface Sensable Phantom Desktop

  13. Interaction with Newton’s Cradle mass ballCount stringLength globalCreation ->Create() Main.x3d (Update) UI.x3d UI.py bounce damping ballRadius Damping, mass, ballCount, stringLength, Bounce, ballRadius, bounce: Parameters of Newton’s cradle controlled by UI components Main.x3d: main modeling file UI.x3d : file used for modeling UI UI.py : to pass messages between UI components

  14. Handle Mirror Reflection Problem Mirror Reflection Scene 1 Scene 2 Scene 3 Scene 4 Scene 5 Scene 6 Transparent Objects Problem of Mirror Reflection Problem : <PlanReflection> have a bug

  15. Handle Mirror Reflection Problem (cont.) Mirror Reflection Scene 1 Scene 2 Scene 3 Scene 4 Scene 5 Scene 6 1. decrease the size of transparent objects 2. untransparentize the objects 1. recover the size of objects 2. transparentize the objects

  16. Cutting Ropes The cylinders for receiving the mouse event Multiple Cuts Single Cut Cutting Rope = Delete node <SingleAxisHingeJoint />

  17. Haptic Feedback SmoothSurface DepthMapSurface HapticTexturesSurface MagneticSurface FrictionalSurface OpenHapticsSurface Make the geometry touchable by defining a touchable surface to the geometry <SmoothSurface/>

  18. Spring Effect Which indicates the force direction SpringForce = - Distance * SpringConstant FrinctionForce = - Velocity * FrictionalConstant SpringConstant = 30 FrictionalConstant = 10 Start: Button Event & Object is touched End: Button Event Special: the feedback of the device would be provided by node < SpringEffect > Spring Effect with Mouse Spring Effect with Haptic Device

  19. Play Sound • Requirements • Two stationary bodies: no sound • The sound function can adjust the volume of the sound according to the intensity of the collision.

  20. Play Sound (cont.) Collision History …,…,… Ball, Board, CollisionTime …,…,… …,…,… …,…,… • Two stationary bodies: no sound …,…,… If Bodies are new Then play sound Else if last collision time+0.01 < Current Collision time Then Play Sound

  21. Play Sound (cont.) • The sound function can adjust the volume of the sound according to the intensity of the collision. Compute the subtraction of velocities on the direction of the center line and map it to 0~1 range to represent the intensity Center line

  22. Conclusion • A Newton’s cradle has been constructed by a physical engine we design. • A Newton’s cradle with haptic feedback has been implemented by H3D. • I get lots of experiences about haptic programming and 3D physical simulation. With these experience, I will still work hard in the further study

More Related