introduction to java3d 1 3d-pool game simulator cs491b aslan neishaboori
Post on 21-Dec-2015
232 views
TRANSCRIPT
![Page 1: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/1.jpg)
Introduction to Java3D 1
3D-Pool Game Simulator
CS491B
Aslan Neishaboori
![Page 2: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/2.jpg)
Introduction to Java3D 2
Background Simulation: CS area of study CS and other fields hand-in-hand Needs data Provides simulators
![Page 3: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/3.jpg)
Introduction to Java3D 3
Background Benefits: Prediction Unknown aspects of the study matter Cost effective
![Page 4: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/4.jpg)
Introduction to Java3D 4
Background 3D Graphics One of important branches of CS Java 3D Involves advance OO programming
![Page 5: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/5.jpg)
Introduction to Java3D 5
3D pool Simulator The data is provided
The physics of the game is known 3D Graphics
Somewhere to start! Pool has a simple Geometry
![Page 6: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/6.jpg)
Introduction to Java3D 6
Objective: Simple presentation Accurate physics
![Page 7: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/7.jpg)
Introduction to Java3D 7
Objectives Add involving physical factors one by one Start with main factors Abstract less important factors
![Page 8: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/8.jpg)
Introduction to Java3D 8
What are the factors? Gravity Cue Friction Velocity Rotation, Spin Elasticity of collisions ….
![Page 9: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/9.jpg)
Introduction to Java3D 9
Spin and Translation!
![Page 10: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/10.jpg)
Introduction to Java3D 10
Linear and angular velocity +Friction!
![Page 11: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/11.jpg)
Introduction to Java3D 11
Simplify: Create a simple working model first Add more functionality to that model
![Page 12: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/12.jpg)
Introduction to Java3D 12
Code! Geometry classes Initialization classes Auxiliary classes Behavior classes Collision detection classes
![Page 13: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/13.jpg)
Introduction to Java3D 13
Scene Graph? A scene graph is a tree-like data structure
that stores, organizes, and renders 3D scene information (3D objects, materials, lights, behaviours ...). It is not a tree It has nodes and arcs (connects the nodes) Nodes are java classes
![Page 14: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/14.jpg)
Introduction to Java3D 14
Content Branch View Branch
![Page 15: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/15.jpg)
Introduction to Java3D 15
BG
TG
TG TG TG TG
TG
TG
TG
TG
TG
Content Branch
![Page 16: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/16.jpg)
Introduction to Java3D 16
Actual code TransformGroup + shape3D’s
BallTG() CueTG() tableGeometry() TableTop() Outlines()
![Page 17: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/17.jpg)
Introduction to Java3D 17
Initializing other classes: Initz_balls() CompleteTable() Init_Cue()
![Page 18: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/18.jpg)
Introduction to Java3D 18
Transformations: Translation Scaling
Reflection Rotation
![Page 19: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/19.jpg)
Introduction to Java3D 19
3D RotationThe 3D rotation matrices about each coordinate:
1
0
0
0
0
cos ( )
sin ( )
0
0
sin ( )
cos ( )
0
0
0
0
1
About x-axis (x-roll)
cos ( )
0
sin ( )
0
0
1
0
0
sin ( )
0
cos ( )
0
0
0
0
1
About y-axis (y-roll)
cos ( )
sin ( )
0
0
sin ( )
cos ( )
0
0
0
0
1
0
0
0
0
1
About z-axis (z-roll)
![Page 20: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/20.jpg)
Introduction to Java3D 20
Behavior Classes: StickMouseTranslate() StickMouseRotate() CueBallCollision() KeyNavigatorBehavior() in pool1() class
![Page 21: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/21.jpg)
Introduction to Java3D 21
Problems JAVA 3D API is complex Collision detection Communication between live nodes
![Page 22: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/22.jpg)
Introduction to Java3D 22
Final word 3D pool covers the whole Java 3D Good practice for OO programming Open source / Online project and….
![Page 23: Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori](https://reader038.vdocuments.net/reader038/viewer/2022102800/56649d625503460f94a45371/html5/thumbnails/23.jpg)
Introduction to Java3D 23
Thank you,