3d physical simulation

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

Upload: bedros

Post on 24-Feb-2016

39 views

Category:

Documents


0 download

DESCRIPTION

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 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: 3D Physical Simulation

Cao HanD-A7-2819-0

Project Supervisor: Dr. Wu WenFaculty of Science and Technology

University of Macau

3D Physical Simulation

Page 2: 3D Physical Simulation

Part I: construct a Newton’s cradle by a physical engine and the C++ language.

Principle of physical simulationNewton’s cradle analysisCollision detectionNumerical ComputationDeformable body simulation

Outline

Page 3: 3D Physical Simulation

Part II: implement a Newton’s cradle with haptic feedback

Interaction with Newton’s cradleScenes SwitchingCutting RopesHaptic FeedbackSpring Effects

Conclusion

Outline (cont.)

Page 4: 3D Physical Simulation

Physical Environme

nt

Resultant Force

AccelerationVelocity

Position

Principle of SimulationProblem: Given the physical environment, to find the position of the object

Page 5: 3D Physical Simulation

Drag

For

ce

Gravity

Drag Force provide centripetal forceDrag Force = centripetal force(1/2mv^2) + the subforce of gravity along the rope

Newton’s cradle analysisProblem: how to compute the sumforce

Page 6: 3D Physical Simulation

If Distance < 2 * radiusCollision Happen

Collision DetectionProblem: Detects if two balls collide

Page 7: 3D Physical Simulation

: the mass of body a : the mass of body b: the velocity of a before the collision : the velocity of b before 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

Energy and Momentum keeps the conservation in the system

Collision Detection (cont.)

12𝑀𝑎𝑉 𝑎

2+12𝑀𝑏𝑉 𝑏

2=12𝑀𝑎𝑉 𝑎 ′

2+12𝑀𝑏𝑉 𝑏′

2

Center line

a b

Page 8: 3D Physical Simulation

The Euler Method

The Fourth-order Runge-Kutta (RK4) Method

Numerical Computation

Problem: given the acceleration, calculate the position every dt time

Page 9: 3D Physical Simulation

The Euler Method

Euler Method

Real motion

Ball

T=92

T=198

T=244

Page 10: 3D Physical Simulation

The Fourth-order Runge-Kutta (RK4) Method

Euler Method

Real motion RK4

Ball

T=66

T=90

T=306

Page 11: 3D Physical Simulation

A particle

Spring Force

Rope

SpringForce = - Distance * SpringConstant FrinctionForce = - Velocity * FrictionalConstant

Which indicates the force direction

Deformable Body Simulation

Page 12: 3D Physical Simulation

Interaction with Newton’s cradleHandle Mirror Reflection ProblemCutting RopesHaptic FeedbackSpring EffectsUser Interface

Part II: Implement a Newton’s cradle with haptic feedback

Sensable Phantom DesktopNominal position resolution 1100 dpi 0.02

mm

Workspace 6 x 5 x 5 inches

16 x 12 x 12 cm

Backdrive friction 0.23 oz. 0.06 N

Maximum exertable force 1.80 lbf. 7.9 N

Continuous exertable force (24 hrs) 0.4 lbf. 1.7 N

Stiffness Approx. 18 lbs./in.

3.16 N/mm

Inertia (apparent mass at tip) <0.10 lbm.

<45 g

Page 13: 3D Physical Simulation

Interaction with Newton’s Cradle

Main.x3d(Update)

UI.x3dUI.py

ballCountmass

ballRadius

damping bounce

stringLength

Main.x3d: main modeling fileUI.x3d : file used for modeling UI

UI.py : to pass messages between UI components

Damping, mass, ballCount, stringLength, Bounce, ballRadius, bounce:Parameters of Newton’s cradle controlled by UI components

globalCreation

->Create()

Page 14: 3D Physical Simulation

Handle Mirror Reflection Problem

Transparent Objects Problem of Mirror Reflection

Mirror Reflection

Scene 1 Scene 2 Scene 6Scene 5Scene 4Scene 3

Problem : <PlanReflection> have a bug

Page 15: 3D Physical Simulation

Handle Mirror Reflection Problem (cont.)

Scene 1 Scene 2 Scene 6Scene 5Scene 4Scene 3

Mirror Reflection

1. decrease the size of transparent objects2. untransparentize the objects

1. recover the size of objects2. transparentize the objects

Page 16: 3D Physical Simulation

The cylinders for receiving the mouse event

Cutting Ropes

Multiple Cuts

Single Cut

Cutting Rope = Delete node <SingleAxisHingeJoint />

Page 17: 3D Physical Simulation

Haptic FeedbackMake the geometry touchable by defining a touchable surface to the geometry

<SmoothSurface/>

SmoothSurface DepthMapSurface HapticTexturesSurface MagneticSurface FrictionalSurface OpenHapticsSurface

Page 18: 3D Physical Simulation

Spring Effect SpringForce = - Distance * SpringConstant FrinctionForce = - Velocity * FrictionalConstantSpringConstant = 30FrictionalConstant = 10

Spring Effect with Mouse

Spring Effect with Haptic Device

Start: Button Event & Object is touchedEnd: Button Event

Special: the feedback of the device would be provided by node < SpringEffect >

Which indicates the force direction

Page 19: 3D Physical Simulation

Requirements

Two stationary bodies: no sound

The sound function can adjust the volume of the sound according to the intensity of the collision.

Play Sound

Page 20: 3D Physical Simulation

Two stationary bodies: no sound

Play Sound (cont.)

Ball, Board, CollisionTime

Collision History…,…,……,…,……,…,……,…,……,…,…

If Bodies are new Then play soundElse if last collision time+0.01 < Current Collision timeThen Play Sound

Page 21: 3D Physical Simulation

The sound function can adjust the volume of the sound according to the intensity of the collision.

Play Sound (cont.)

Center line

Compute the subtraction of velocities on the

direction of the center line and map it to 0~1 range to represent the

intensity

Page 22: 3D Physical Simulation

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

Conclusion