Home
3-Dimensional Display of the Trajectory of a Golf Ball
Contents
1. sssse 25 4 4 2 Summary MT aoDIHCatlOTis au cote itp epa d oe aos Ua iO 25 4 5 Decision of what languaggsig use 4 6 Flight calculation of a 4 6 1 Research on trajecto i 4 6 2 Euler s Forward metho 4 6 3 Concern on trajectory formul 4 6 4 Golf trajectory formulas 4 Implementation of the design versi 4 7 1 Sample section of applicatio 4 7 2 Summary of the application v 4 8 Resolve error on application version e 4 8 1 Additional formulas E 4 9 Implementation of the design version 3 0A HH 31 4 9 1 Sample section of application version 3 iid ttd aa Ro etat 31 4 9 2 Summary of the application version 3 3 A Mou d tesa adt 32 4 10 3D golf course VRML uses eer e e e ees 33 UE oo PREMIER oa 33 AVDA WrmlPad us atem iem te endete re Nee s 33 4112 JC eee tantus deoa lead et epa ius D 4 dll Note PAG ccc odie contia site v ben a ata mto 4 12 Implementation of VRML golf course of 4 12 1 Sample section of the 3D golf cout nnn f pdcewausints 34 4 12 2 Summary of VRML golf course sse La messes 36 4 13 Screen shots of final VRML golf course sssssses Q MIA 36 4 14 Final implementation escasa tige quss tatto axo ba de e E e Rus kinda 37 4 14 1 Separation of files methods sse rt tener tne 38 4 14 2 Sample section of Final application eeeee 39 4 14 3 Plow Chart Final applications use e Doe bx
2. 0 0 1 varl Figure 15 Design structure D Note Design structure can be updated at anytime through out the Ko s 4 6 Flight calculation of a golf ball Q After confirming that Java and VRML work well together the next step is the mathematic formula of the golf ball flight movements Cindy Yung 26 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report This section is divided into two sub sections which include Research on trajectory calculation and Euler s Forward method 4 6 1 Research on trajectory calculation To achieye an accurate simulation there is a need to understand the physics of golf ern to calculate different movement with the help from Euler s 4 6 2 Evle orward method Euler s Forward 9 is simple and flexible once the logic behind is understood f Pel The advantage o d orward Method is that it can be used in Microsoft Excel which makes calculati he frajectory easy The common forms of Euler s Forward Method are descgitf d low Formula 1 Method to solve R time 7 t0 At vx t1 vx to At vx to dvx to e vy t1 vy to At vy t0 dvy to dt A z Formula 2 Method for the components of positio x ti x to At x to vx to At y ti yfo AY y t tot Q The method is going through At which uses the ien the beginning of the interval value 0 The metho
3. 2 What do you think of the look and effect of the interface H Excellent BlGood LlAverage 4 OPoor Others CA 3 Does the 3D golf course match up in the real world ElSeries1 ON oo OO 12 Yes No X 4 How would you feel if instruction is added in the interface Would this provide better usage El Series1 Yes No 5 By adding a background image or a company logo does it provide a professional look and identity ElSeries1 Te True False oN A Oo o 6 Is it easy to use the VRML browser functions ie navigate around the golf course ElSeries1 Yes No ENF a 7 What do you think of the images used in the VRML Golf course 0 1 lo Excellent 3 BlGood LlAverage LIPoor llOthers 9 Would you like to have more golf courses to choose from 10 ElSeries1 Cindy Yung 114 ud Department of Electronic Communication and Electrical Engineering BSc BEng Final Year Project Report c BEng Final Year Project Repo University of Hertfordshire 10 Would you like to access the simulator through the Internet El Series1 O No RO OX Yes No Cindy Yung 115 U Department of Electronic Communication and
4. Figure 19 Sample section of VRML golf draw a SFNode Typically used CU a property node course part 1 that controls how shape node shape VRMLnode ImageTexture node specifies texture mapping attributes i9 locate where image is stored 11 SFFloat Floating point values Large or small positive or negative values without a decimal point Cindy Yung 34 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report Hine no Description 14 Group node together node together 4 Children field EE M a list of child nodes to be included in the group DEF defines node and can be reused specifies appearance attributes 22 specifies material attributes by default it creates shaded white shapes 14 DEF sa exported object Group 15 16 children 17 18 DEF PlaneOi FACES Shape 19 20 appearance Appearance 21 22 material Material 23 24 ambientIntensity 0 1 25 diffuseColor 0 5 0 5 0 5 26 shininess 0 2875 27 specularColor 0 045 0 045 0 045 28 Y 24 ambientIntensity controls how the material is LH Stesedbyhomnbensigh level of he weld Figure 20 Sample s Ctigif of VRML golf higher values more shiny 27 specifies the RGB specularColor of light reflected 77 29 texture IS texture rane no Description 30 IndexedFaceSet creates face geometry and can 31 geometry IndexedFaceSet be used as value for geometry
5. If For the VRML golf courses source codes it can be found in the CD ole Cindy Yung 79 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire Golfinput java Interface import java awt import java awt event import jasf x swing impogt javax swing border JFE lt p gt Fini Project Code lt p gt Main clg s t the image processing class give userthg amp ego choose from either automatic or manual progessing mode author Cindy YQ version 2 0 Lo public class GolfInput 43 JEgame BSc BEng Final Year Project Report ITT r A ABLES MMIII te private JButton button private JPanel Contro private JPanel BottomPanel private JLabel valLabel val2ab m sideSpinLabel Version bel m backSpinLabel 2 action private JTextField vall val2 val3 Spin m sideSpin private JComboBox golfChoiceBoxf private GridLayout grid private String golfCourseNames Golf 01 Golf course 02 Golf course 03 private Icon icons new Imagelcon gol Q ames 0 new Imagelcon golfCourseName Pes Imagelcon golfCourseNames 2 PS private int golfCourseChoice 0 A public GolfInput O super Golf Input setting the GUI with windows feel grid new GridLayout 1 0 0 0 Container container getContentPane container setLayout gridl ControlPanel new JPanel CQ S e Border ControlPanelBorder BorderFa
6. Result submit d 4 Golf wrl generated and viewable Golf wrl failed to generate or viewable Golf wrl failed to be generated or viewable Result submitted Golf al failed to be generated or viewable Test to see if any positive Golf wrl Golf wrl T negative and decimal points generated and generated and Cindy Yung 42 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire jiegmemedmdseee o o De be generated and viewable 10 Test to see if values O inserted Gol wrl Golf wrl was would Golf wrl be generated generated and generated but and viewable viewable failed to open Golf wrl test to see if Click Sign pole Sign pole icon here to replay your shot sign replayed the replayed the pole replays the simulation simulation simulation All VRML All VRML p browser functions browser functions BSc BEng Final Year Project Report fhulation the way it was interacted with interacted with i Lg ned the simulation as the simulation as planned planned golf course golf course automatically automatically adjusted to the adjusted to the browser size browser size Table 7 Test result Application and Golf cougse Description Expected result Actual result x Interface Insert values in all t fields on Golf course 03 b imearnewanea o ean am some of the text fields 2 submit Interface Insert symb
7. U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report Ww n n Transform n children n Transform n rotation 0 1 0 2 513 n children USE BOX n n n n Shape n appearance Appearance material Material diffuseColor 0 0 1 0 geometry Box size 100 0 1 100 n n n n n n n n Transform n translation 3 5 0 n children n DEF TOUCH TouchSensor n Shape n appearance Appearance material Material geometry Sphere radius 25 n n n n n DEF TIME TimeSensor n loop TRUE n n n DEF PI PositionInterpolator n key 0 51 n keyValue 000 0 5 Posi 0 0 Pos2 n n DEF SCRIPT Script n eventIn SFBool set val n n field SFBool first TRUE n field SFInt32 i 0 n field SFNode timer USE TIME n field SFNode interp USE PI n field SFNode root USE ROOT n n directOutput TRUE n url V javascript n n function set_val clicked n if clicked n if first 4 n first false n Browser addRoute timer fraction changed interp set fraction n n else n if i gt 0 4 Browser deleteRoute interp value changed root children i 1 set translation n 5 else Browser deleteRoute interp value changed Cindy Yung 61 Departmen
8. rightLeft n System out printIn Current Pos i distance distance height height Right Left rightLeft preDistance distance preHeight height preRightLeft rightLeft sb append n DEF SCRIPT Script n eventIn SFBool set val n n field SFBool first TRUE n field SFInt32 i 0 n field SFNode timer USE TIME n field SFNode interp USE PI n field SFNode root USE ROOT n n directOutput TRUE n url javascript n n function set_val clicked n if clicked n if first n first false n Browser addRoute timer fraction changed interp set fraction n n else n if i gt 0 Browser deleteRoute interp value changed root children i 1 set translation n T else Browser deleteRoute interp value changed root children root children length 1 set translation n i n n Browser addRoute interp value changed root children i set translation n i n i root children length n n n n V n n n ROUTE TOUCH isActive TO SCRIPT set val n System out printIn sb toString out write sb toString out close catch IOException e 4 3 Cindy Yung TT U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report private static
9. 5 Interface Insert values 0 on 4 NS eult submitted Result submitted ff text fields Test to see if all values inserted io If Golf wrl would Golf wrl be generated Sent generated and and viewable i e viewable 7 Test to see if some values f Golf wrl failed inserted would Golf wrl be erae ot to generate or generated and viewable i s viewable Test to see if symbols or alphabets is inserted would Golf wrl be generated and viewable Test to see if any positive Golf wrl negative and decimal points generated and values inserted would Gol wrl viewable be generated and viewable 10 Test to see if values O inserted Golf wrl would Golf wrl be generated generated and generatetisbut and viewable viewable failed to open 11 Golf wrl click on golfTek golfTek web golfTek web billboard to launch its web sites site launched ina site launched in a 2 in a new window new window new window 1 Golf wrl click on lindsayGolf lindsayGolf web lindsayGolf web billboard to launch its web sites site launched ina site launched in a Cindy Yung 41 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report in a new window new window new window es Golf wrl click on p3proswing billboard to launch its web sites in a new window Golf wrl test to see if Click
10. e Page Do xt viewpoint e Page Up eo viewpoint Pause Enables or seo m PlaneSensor SphereSensor and TouchSensor in Cortona vfu ien To accelerate the camera s movemenftesrotation Press SHIFT CTRL or SHIFT CTRL and one of the Nr m The ALT and SPACE keys allow the TAC uickly change the navigation option to PAN and TURN accordingly in the FLY navig tion mode to ROLL and PLAN in the STUDY mode The ALT and SPACE keys si neously pressed activate ROLL in the FLY navigation mode or PAN in STUDY Interacting with the Scene Oe Some of the objects in the scene may provide special effects llow the user to interact with the scene in different ways As you position the Cate the object j d Touch Sensor Detects a click or the pointer over the obj Meson of activity in the scene is decided by the VRML author Q containing a VRML sensor the pointer changes ub Anchor Clicking will link to the other object VRML world or HTML document Cindy Yung 111 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 4 Cylinder Sensor Transforms pointer motion into a rotation of the object around its axis ty O Sphere Sensor Transforms pointer motion into a rotation of the object e its two axes O Sensor Transforms pointer motion into a moving of the object ir Ay p Sensor VRML extension Handling a drag an
11. Sample section of application versio The source codes for the final application is placed in Ap fend 4 14 3 Flow Chart Final application Figure 36 Final Application Cindy Yung Read the original VRML file until it reaches the line REPLACECODEHERE This is where the calculated data from the trajectory formulas will be placed A cowriterite ava 39 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 4 14 4 Summary of the Final implementation The outcome of the application simulation was successful with bonus feature The results are shown in the table below Table 4 Outcome results Final application Expegfed result Actual result Three files had been separated into Java interface Java application and Edited version of VRML A VRML filgaled Golf wrl should be A Golf wrl had been generated generated The Golf wrl AV a the Golf wrl displayed the golf ball trajectory simulation of the gll trajectory using the values inputted from the interface Click me to replay your f the latest trajectory The Bonus features are Two O had been added to the final application in total there are three g to choose from The bonus golf courses provide an exciting experience using thgssimulation with various options to view the trajectory of a golf ball Screens A golf courses are placed in Appendix D By adding
12. cycleInterval 5 0 n loop TRUE n n n DEF PI PositionInterpolator n key n 0 00 n 0 01 n 0 02 n Cindy Yung 74 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report Cindy Yung 75 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n keyValue 00 0 n initial calculation vA callnitialVa speed vAngle rightLeftVal vB callnitialVb speed vAngle vC callnitialVc speed vAngle rightLeftVal alpha calAlpha sideSpin backSpin for int i20 i lt 100 i if i gt 0 if height lt 0 vA calVa vA vB vC v alpha vB calVb vA vB v vC calVc vA vC v alpha v calV vA vB vC distance distance 0 1 vA Cindy Yung 76 Department of Electronic Communication and Electrical Engineering k U BSc BEng Final Year Project Report University of Hertfordshire height height vB 0 1 rightLeft rightLeft vC 0 1 if i lt 99 sb append distance height rightLeft n else sb append distance height
13. gE 6s Use FLY PLAN to move left or right Forward move the camera forward towards its longitudinal axis 1 d Backward move the camera backward Right turn the camera to the right around its vertical axis Cindy Yung 106 Department of Electronic Communication and Electrical Engineering HO University of Hertfordshire BSc BEng Final Year Project Report P Left turn the camera to the left around its vertical axis Note The camera s vertical axis may be inclined in a 3D Space Move the mouse while holding down the ALT key to switch FLY PAN Movgfthe mouse while holding down the Space key to switch FLY TURN Move 2 while holding down the ALT Space keys to switch FLY ROLL 9 and Q Use FLY PAN to e Up down left or right within a single vertical plane A 5 AR Forward move up Vy TF Backward move down O c a S Right move right Left move left K Note When you move the camera the world w to move in the opposite direction P O 9 and e On Use FLY TURN to turn the camera QD j d Forward turn the camera upward around its horizontal axis CA Backward turn the camera downward around its horizontal axis S Right turn the camera to the right around its vertical axis 9 C d p Left turn the camera to the left around its vertical axis Cindy Yung 107 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire 9 and Use FLY ROLL t
14. give user choice to choose from either automatic or manual processing mode author Cindy Yung Qversion 1 0 public class GolfInput extends JFrame WEIT HTT INSTANCE VARIABLES T M BM IIT 1 private JButton buttonEnter private JPanel ControlPanel private JPanel BottomPanel private JLabel valLabel val2abel val3label Version private JTextField vali val2 val3 private GridLayout grid1 public GolfInput super Golf Input setting the GUI with windows feel WindowuUtilities setNativeLookAndFeel gridi new GridLayout 2 1 5 0 Container container getContentPane container setLayout grid1 ControlPanel new JPanel Border ControlPanelBorder BorderFactory createTitledBorder Golf Value ControlPanel setBorder ControlPanelBorder valLabel new JLabel Please enter Speed m s ControlPanel add valLabel Cindy Yung 63 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report ControlPanel setLayout new GridLayout 2 2 5 0 vall new JTextField 10 ControlPanel add vall ControlPanel setLayout new GridLayout 3 3 5 0 val2abel new JLabel Pleae enter Vertical angle deg ControlPanel add val2abel ControlPanel setLayout new GridLayout 3 3 5 0 val2 new JTextField 10 ControlPanel add val2 ControlPanel setLayout new GridLayout 4 4 5 0 val3label new JLabel
15. is positive along the Y axis the coordinate presents 0 0 Y 0 0 Z axis As seen from Figure 2 line from far is n vati to close is positive along the Z axis the coordinate presents 0 0 0 0 Z 2 2 1 Right Hand rule Q Using the right hand rule it is to refer to the default axis in a 3D worl whjth gan also be used to identify positive rotation The figures below will explain in Q Cindy Yung 5 U Department of Electronic Communication and Electrical Engineering BSc BEng Final Year Project Report University of Hertfordshire gt fy oN Right Hand Rule L Figure 3 Right Hand Rule Q Source xvrml net Thumb point to posit Index finger point to pospite Middle finger point to po y In rotating an object right hand ru 9 lp identify which direction to rotate Figure 4 s Four fingures Indicate positive direction of rotation t Right Hand Rule Rotation e Thumb Point at a positive axis Figure 4 Right Hand Rule for rotation Source xvrml net QD Thumb point along a positive axis depends on which axis you are goi Caf rotate Other four fingers indicate the positive direction of rotation Note In VRML angle of degrees need to convert to radius the formula is as follows number of degrees 360 3 14 Cindy Yung 6 j Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Re
16. javac GolfInput java Press Enter Figure java GolfInput Press Enter Figure 12 Q Pe C WINDOWS system32 cmd exe 8 x Microsoft Windows XP Version 5 1 2666 lt C gt Copyright 1985 2661 Microsoft Corp C Documents and Settings Nutty gt cd HERR Figure 9 Type ed in Command Prompt 101 Cindy Yung U Department of Electronic Communication and Electrical Engineering BSc BEng Final Year Project R i University of Hertfordshire a ie ial ce C WINDOWS system32 cmd exe o x Microsoft Windows XP Version 5 1 2666 A lt C gt Copyright 1985 2661 Microsoft Corp C Documents and Settings Nutty gt cd C gt cd fyp versionS C Fyp vers ionS gt _ Figure pt fyp version5 in Command Prompt C WINDOWS system32 cmd exe jol X Microsoft Windows XP Version 5 1 2666 lt C gt Copyright 1985 2661 Microsoft Corp C Documents and Settings Nutty gt cd C gt cd fyp versionS C Fyp versionS gt javac GolfInput java C Fyp vers ionS gt Figure 11 Type javac GolfInput java in CommandWr gt Cy x 102 Cindy Yung U Department of Electronic Communication and Electrical Engineering BSc BEne Final Year Project R i University of Hertfordshire DIC QUEUNT ANOTAR C WINDOWS system32 cmd exe java Golflnput zi x Microsoft Windows XP Version 5 1 2666 lt C gt Copyright 1985 2661 Microsoft Corp C Documents and Settings Nutty gt cd C gt cd fyp versionS C Fyp
17. radius 0 5 n n n n n n Transform n children n Transform rotation 0 1 0 628 children USE BOX Cindy Yung 65 U Cindy Yung Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report n Transform n children n Transform n rotation O 1 0 1 256 n children USE BOX n n n n n Transform n children n Transform n rotation 0 1 0 1 885 n children USE BOX n n n n n Transform n children n Transform n rotation 0 1 0 2 513 n children USE BOX n n n n Shape n appearance Appearance material Material diffuseColor 0 0 1 0 geometry Box size 400 0 1 50 n n n n n n n n Transform n translation 3 5 0 n children n DEF TOUCH TouchSensor n Shape n appearance Appearance material Material geometry Sphere radius 25 n n n n n DEF TIME TimeSensor n loop TRUE n n n DEF PI PositionInterpolator n key n 0 00 n 0 01 n 0 02 n 0 03 n 0 04 n 0 05 n 0 06 n 0 07 n 0 08 n 0 09 n 0 1 n 66 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Rep
18. 1 GolfInput null Methods public void itemState P9 event Source code Sotinputs2 ees JBuilder API Decompiler stub source E class file 21 Apr 2006 implementation of methods is not availab Imports Q import java awt event ActionEvent t import java awt event ActionListener PS class 2 implements ActionListener A Constructors O 2 GolfInput null Methods E public void actionPerformed ActionEvent ae e Cindy Yung 89 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report Implemented structure structure of ReadWriteFile class A structure 0 K Ox mg S a ts 5 9 d Raa gt di ReacwriteFile d ReadvVriteFile double val double val2 double val3 double val4 double val5 int val6 calAlpha double SideSpin double BackSpin callnitial a double x double y double z callnitial double x double y callnitial c double x double y double z calv double s A double YB double YC calva double V A double VB double YC double Y double Alpha calvb double VA double VB double s calv c double vw amp double VC double Vw double Alpha getContents replace String alnput String aOldPattern String aMewvPattern setContent double speed double vAngle double rightLeftval double backSpin double sideSpin golfCourseChoice preval preValB prevalC 9 9
19. 7 or a later e Adobe PhotoShop 7 or a later vessto e VRML browser plug in 3 3 3 Hardware e Intel Pentium 4 2 0GHz e Minimum 128MB RAM e Graphic card OpenGL or DirectX e O S Window XP or a later version P 3 4 Summary This chapter is paying attention on user and developer requirements Withgfffe requirements listed this will provide a high quality view of the 3D golf sim latigh Note Hardware is noted to its minimum specification with a more powerful machine the better it is Cindy Yung 21 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 4 Methodology Implementation 4 1 Introduction In this segtion the design and implementation process of this project are explained in details The situ is the most important part of this project in order to complete the project most time was spent on research and planning A carefully planned design will O implementation and future upgrade by examining all h different scenarios t appen Dar 4 2 Stages inc Je the suitable Languages Testing different types of 3D langu hat can be interacted in a 3D scenes should firstly be started O 4 2 1 The First language ne odi Java 3D tried an example from Java 3D Pr ming By Daniel Selman 8 It gives an animated scene including a graphi OQ background with directional endi C VRML 2 0 creates a wrl file which
20. Collision ip Di ber Eee oues teen etos odtetandt disedbefaes 50 VRML History M Good VRML History Vrml1 Vs Vimb sae aue eee VRML Cortona Client VRML WEDS ostiis abdo cdae arene Vrml97 Web3d sseessss 9 VRML OT SEG cote e tias xa e deb Ade p E 51 VRML 2 0 Vs X3D NENNEN CA EET 51 VRMI SYA TAX 5 asas inten nona nao e ee eaaa Uri bs tastes tienes 51 MICROSOFT EXCEL sc a acodnteareaatia S xe E cantor 51 If Statement In BXCGl a oue e dto ol o bas NN iae 24 UATE Excel uot n otto as ot od bo a ood E Rad e jq NN 51 Sgtrt Excelasc iius ute ih roti ads tise quies Ne E aee 51 Maths Euler s Method Golf Ball D Golf Information aon vH aq i Oa ad da ees Dimples Vs Smooth Golf Ball of History Of golf Ball uie eoo eI ia IUe o idend Brief history of golfo cette aote tte oe deu tede uo es ay Find The Right Ball For Your Game essen Q IEEE 52 Golf Ball Aso ten Ld b pa iota Rho A beads aat tul cd apos dus tavi un fodit 52 CIT to tuit n ee eie e Nes aec ne 52 CGiolb N ico D EN EET n Ma ENA EE a a RU 52 3D Golf simulation ete SERO E AAE IE A SD NR pU 53 JAVA RBSBEARODL icetslcne iv i reste eel nt le A elt iei 53 Jaya di ETE stood aad tuba aha hambus ORE RARE CSN RTE E 53 Basic Java naa in EE nek tel Ace ei nek else TUNER 53 Cindy Yung V U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Fin
21. Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report Appendix I Story board Inte e designs CFigtre 61 Interface design 01 feof Tapat Value 2 Value am Value 4 Mag 5 Pick x Golf carne Y at a3 a Gdf value Please ertet Spee CUES lease exter angie aen Remo enter Right feft deg Pleaso enter Backspui Pleo eter Siolespin Please select a Gol couse Figure 63 Interface design 03 Cindy Yung 116 U o Department of Electronic Communication and Electrical Engineering BSc BEng Final Year Project Report University of Hertfordshire Golf course designs Figure 65 Golf course design 02 Figure 66 Golf course design 03 Figure 67 Golf use Golf course design 03 Cindy Yung 117 U Department of Electronic Communication and Electrical Engineering BSc BEng Final Year Project Report University of Hertfordshire Appendix J Project Time Plan Gantt Chart Initidf time phan was made optimistically as some tasks were not carried out and some ame nts were made in the process of the projects As a resul p ated version of the time plan is produced which is accompanied with the origi 118 Cindy Yung U Qo Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report Initial Project Ting Plan Gantt Chart vean erro pina ise s Name Dura
22. Engineering University of Hertfordshire BSc BEng Final Year Project Report it flies This is helpful because the dimples would scoop the air back towards the rear of the ball By moving more air to the rear it prevent the air pressure to drop behind the ball By doing this the amount of air pressure pulling backwards on the ball is decreased A diagram to show the affect of dimples with varying depths on a golf ball s disffince P Dimples Appropriate depth s Shallow 100 200 300 yards 9 Ff Dimples Range Of A Golf Ball rce ffden 2 phys uaf edu 2 7 Research of 3D ede websites Various websites were examined with an Bo information ideas and layout so as to analyse and produce top of the range e PM Of course at this t moment there is no such web site existing over ef it is purely gathering information to produce a successful 3D golf simulati UN 2 7 1 TopGolf 0 http www topgolf co uk chigwell htm AY TopGolf is a point scoring game with high tech driving range Aim to get many points as possible by hitting chipped golf balls into any eleven targets on gen acre outfield After each shot an exact distance ball travelled and the score is in relayed to a screen in your bay These are the stages on how TopGolf works Cindy Yung 17 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report Step 1
23. JFrame EXIT ON CLOSE Cindy Yung 72 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire Version 3 ReadWriteFile java Source code import java io import java lang Math import java lang String import java text NumberFormat import java text DecimalFormat public class ReadWriteFile 4 public double preValA 0 00 public double preValB 0 00 public double preValC 0 00 public ReadWriteFile 4 public ReadWriteFile double val double val2 double val3 double val4 double val5 1 setContent val val2 val3 val4 val5 H static public void setContent double speed double vAngle double rightLeftVal double backSpin double sideSpin StringBuffer sb new StringBuffer double distance 0 00 height 0 00 rightLeft 0 00 double vA 0 00 vB 0 00 vC 0 00 v 0 00 alpha 0 00 double preDistance 0 00 preHeight 0 00 preRightLeft 0 00 System out printIn New input speed System out printin New input 2 vAngle System out printin New input 3 rightLeftVal try FileWriter new FileWriter BufferedWriter out new BufferedWriter new FileWriter c Fyp version3 Golf wrl false sb append VRML V2 0 utf8 n n NavigationInfo 4 headlight TRUE type EXAMINE ANY n Background skyColor 333 333 333 M Viewpoint n position 10 0 8 0
24. United States of America 2003 2 http web3d org x3d specifications vrml VRML1 0 index html The Wirtugfffeality Modelling Language 3 http web3d org x3d overview html Java Language Basts By Kevin Yank 5 H M Deitel and pf Java How To Program 5 Edition Prentice Hall 2 ax United States of Amer By Eric W Weisstein The Forward Euler Metha Ose 11 Microsoft Excel Help 2003 ATAN 12 http Awww parallelgraphics com O 13 http Java sun com j2se 1 4 2 docs a Th m Sun Microsystems 14 Peter McBride Java Made SimpleB Made Simple Books hey win 1997 99 15 http java sun com j2se 1 4 2 docs api java lang StringBuffer html Sun Microsystems CA 16 http chortle ccsu ctstateu edu CS151 Notes chap83 ch83_3 html Q By Bradley Kjell Central Connecticut State University 17 http www web3d org x3d specifications ISO IEC 19776 X3DEncodings XML ClassicVRML Part02 examples html Extensible 3D X3D encodings Part 2 Classic VRML encoding Cindy Yung 47 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report BIBLIOGRAPHY Rodger Lea Kouichi Matsuda and Ken Miyashita Java for 3D and VRML worlds New Riders United States of America 1996 diis and Doug Gehringer Java 3D API Jump Start Prentice Hall PRT United S s of America 2002 7 H M Deitel an PDeitel Java How To Program sh Edition Prentice Hall U
25. VA 0 0019 V 0 25 VA 0 2 VC Alpha VB vB 0 0 vC 0 0 private static double calVb double VA double VB double V else return VB 0 98 0 0019 V 0 25 VB 0 2 VA vA calVa vA vB vC v alpha vB calVb vA vB v vC calVc vA vC v alpha private static double calVc double VA double VC double V double Alpha return VC 0 0019 V 0 25 VC 0 2 VA Alpha Figure 18 Sample section of application version 3 ReadWriteFile java Cindy Yung 3l U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 4 9 2 Summary of the application version 3 The outcome of the application was successful The VRML displayed a smooth curve trajectory The final outcomes are shown below Table 3 Otitcome results version 3 Actual result Two extra elds will be implemented Five text fields are displayed which are into the intesfacgf n total there are five text Speed m s Vertical angle deg fields dice di m s Vertical angle Right left deg Blackspin revs sec deg Right left H Przctspin revs sec and Sidespin revs sec and Sidespin revs se Y The additional formulasWw1 ftnplemented Calculations are in place in the Java into the Java application application A new wrl file to be generated i New VRML file called golf wrl has extension of VRML been generated The outcome effect should be a smoo
26. a remote computer that users connect to via a Web browser Applets are loaded froga remote computer into the browser to execute 1 Q Applet can also be executed from the command ee the appletviewer command m commonly referred to as the minimum browser it knows efily bow to interpret applets 1 e Q provided with the Java 2 Software Development Kit J2 The appletviewer is Cindy Yung xli U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 1 Introduction From the start it was obvious the project title 3 Dimensional Display of the Trajectg of a Golf Ball will involve 3 Dimensional language such as VRML for the o tco isplay some type of mathematics calculation language such as Java for P ectory and Golf knowledge to understand overall of golf This would requir t of research to fully understand and achieve the project The project title Bri as follows This project is part d projects for a state of the art golf driving range Given the velocity and spin o f this project will involve the production of a 3D animation of the trajectory ball using tools such as VRML and JAVA A mathematical module will ed to calculate the trajectory It should overlay the animation on an image of an exj olf course Z 1 1 Project Aims The project aims to develop a 3D simulation A ball trajectory When the ball is hit an applicat
27. asp 3D Golf Simulation http www gports coach com mainprod aspx 3D golf simulation http Le Wa http ww PE f co uk chigwell htm http www go om http www parm olf com fw main Golf Simulators 268 html http www forgeficcgfff emos golf 0 17 htm http www 3dnature c Ifasc html 3D golf courses http www turbosquid c review Index cfm ID 299793 3d golf course http www superscape co itle php CGTO 3D overview 3D game http www kahootz com au kz tem ome ShowcaseExample6 vm 3D golf course a JAVA RESEARCH Java 3d Site NO WM LAQUEUM lege on http www javaworld com javaworld jw 01 1999 jw Oo http www anfyteam com panfy3d html http www sdsc edu nadeau Courses Siggraph99 http www freeprogrammingresources com java graphics tutor http java sun com developer onlineTraining java3d http java sun com developer onlineTraining javaai jai index html Py Basic Java Q http www sitepoint com article java language basics Buffer Replace http www javapractices com Topic80 cjp Cindy Yung 53 U Department of Electronic Communication and Electrical Engineering BSc BEng Final Year Project Report University of Hertfordshire Read And Write A File http www javapractices com Topic42 cjp String Buffer sun com j2se 1 4 2 docs api Java lang StringBuffer html File Streams docs books tutorial essential io filestreams html Read a file O using BufferedReader and System o
28. by the UTF format in which case there will be up to three bytes per TA characters from the file are translated into character format 3 0 0 020 0 0 0 0 8 bit 16 bit characters characters ava Prov Figure 13 Java IO class Cindy Yung 24 Department of Electronic Communication and Electrical Engineering U University of Hertfordshire BSc BEng Final Year Project Report 4 4 implementation of initial design With the finding on research now is time to put the theory in practice The idea is to build the application using the VRML example mentioned in Chapter 4 1 2 to display the outcgghe with two text fields in java for changing the VRML value The nd re should contain a NEW file called Golf wrl a Java interface with input da esult of the submission from the interface which display the new VRML fil wrl 4 4 1 Sample ion of initial application import java io public class ReadWriteFile ublic ReadWriteFile i a K f b Specify the public ReadWriteFile int val int val2 ey vale te location of new setContent val val2 changed in the t VRMI file file to be written to static public void setContent int Posl int Pos2 mE 1 System out printIn New input 4 4 Posl The content of the System out printIn New input 2 Pos2 original VRML try file FileWriter new FileWriter out it VRML V2 0 utf tnin e j out
29. contains a touch Qu that VRML can lighting outcome example can be found in App 4 2 2 The Second language tested interact with end user The uncertainty on this language i ether it can take dynamic input outcome example can be found in Appendix A 4 2 3 The Third language tested A X3D as mentioned on Chapter 2 2 3 X3D is the next generation of V can do much more than VRML the downside is author has no experience of this age Thus it may slow down the process on the project outcome example can be found in Appendix A Cindy Yung 22 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 43 Preliminary findings To find out which languages are suitable for this project an initial application will be created by using Java JSP web browsers and VRML Below is figure 12 showing the concept gfthe initial application 4 Interface Web browsers Interface Form Collection 0 0 1 varl Static JSP or Java Write VRML code to text VRMLI wrl new file created Figure 12 Concept of iniffal application 4 3 1 Background information on Me ementation Before building the initial application there is a MT if VRML supports int float double etc What kind of Java IO class is MG text output into a text file in java should also be looked at 4 3 2 VRML Data type E The table below shows VRML does support
30. development stages in construction of the golf course Cy Figure 24 Stage 3 Figure 22 Stage 1 Figure 25 Stage 4 Figure 26 Stage 5 Figure 27 Stage 6 Figure 28 Stage 7 Figure 29 Stage 8 Figure 31 Stage 10 Figure 32 Stage 10 Cindy Yung 36 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report zt mCtick mo toa Repla E your shot a aus v Figure 33 Stage 12 4 14 Final implemen fon 1 3 the VRML source code is imbedded in A o provide an unprofessional style in programming To achieve a professional stylegfe application should be separated into four files including 1 The Java interface As understood from application ve the Java application Under such si 2 The application which is the Java file co type trajectory formulas 3 The VRML golf course without the Ko vale points on the golf ball Q 4 The generated Golf wrl with the new KeyValue fr f gsf users inputs The expected outcome of the final application should be as RO e Four separated files Java interface with five text fields ps Java application contains the trajectory formulas Edited version of VRML golf course without the predefined Qa on golf ball in VRML term KeyVaule this will be replaced with the input data from end user Anew VRML file called Golf wrl should be gene
31. dpplicatiofi scie al Noob Oe D COO A RR HAS 70 Version 3 GolfInpt java Source code 9 71 Version 3 ReadWriteFile java Sourc sitar wise oas tette satan etas indus tegis 73 Appendix C ca ice e tote doa a Whee ee uu IE 79 GolfInput java Interface eee ReadWriteFile java The main program Q poreetuteebes ette Implemented structure of GolfInput class Source code GolfInput class d CM Source code GolfInput 1 class sssssssss 4 Source code GolfInput 2 class ssssssss EM Meuse Implemented structure structure of ReadWriteFile class Source code Read WriteFile class eee fees Ls Appendix ee ee ee Me E 9 Screen Shots of all VRML Golf courses essse Ie aes 9 Goli Course Olmerts niari nn tipa Rca qu ips vue M ipsus Q niak 91 OTE COMPSE O2 riota on aaa a e a O E E tage E 92 Golf Course 03 aada se bs aE eE E AEAEE S vagas d Op E e nd v er Meets 93 Append Biss S isa e Cet ad Est foU a d an 94 Golf course Multiple point VIC WS sisse Cia usati estet atta chalet nn deis i 94 JUODDEHECB sse c ML M xe CUL 95 Test Results screett sliofS ceased oen are eda piece enm auam 95 Cindy Yung vi U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report Appendix Oo aces ih res see tal eee MN eM cee cus ay D cm nae 96 LEFT EIDEM C 96 How t
32. extra golf courses the application has Era very powerful Not only can it calculate a complicated physics it also dis O and accurate trajectory ofa golf ball in a 3D environment As a result ication has become more intelligent although it looks simple Q 4 15 Summary A b In this chapter description are made for each stage of the design and eats through out the process if this project It will also cover the difficulties coa during development of the application with summaries of the result for each stage Cindy Yung 40 L j Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 5 Testing 5 1 introduction ys an important role in the development of the application It is constantly d debugged during the process as shown in various stages of develop P implementation In the final application the test results for each golf ed in three separate tables below course are D 5 2 Test Kw Application and Golf course 01 Table 5 Test result Testno Descriptign Y Expected result Actual result x fields on Goff cefifse 01 2 Interface Insert vaf es on only EE some of the tesefields submit 3 Interface Insert symbol alphabets values in thd 5 ds submit submit 4 Interface Insert any values Result submitted Result submitted positive negative and deep af ation and Golf course 01 points in all text fields
33. instruction if coktvr e does not work on your machine you can download from a third party ussite P ig File Edit View Favorites Tools Help ay Bac gt 2 JO search j Folders E Address C3 C Documents and Settings Nutty Desktop Fyp ivl Go File and Folder Tasks F Magnus ee QJ Make a new folder Publish this folder to the Web E3 Share this folder Other Places amp Desktop E My Documents Shared Documents P My Computer a My Network Places Details Figure 5 Installing VRML Foyer Once the VRML Browser is installed right click on Fyp Poised select Cut Figure 6 and Paste folder into your current Drive I will TODA C Figure 7 e Cindy Yung 99 ud Department of Electronic Communication and Electrical Engineering BSc BEne Final Year Project Report c BEng Final Year Project Repo University of Hertfordshire I 2 i ig Scan with Norton AntiVirus p Send To Figure 6 ihg Fyp folder A Huge I C Fie Edit View Favorites Tools Help ay Qa B se gy roten rii Address C M m Go Name Date Modified systemTasks Q Bar 07 03 2005 19 37 Hide the contents of i 09 11 2005 15 35 this drive Borland 12 03 2006 12 23 ZS Add or remove C c0b55b733f6ad726b7 06 03 2005 20 19 programs Development 19 03 2006 13 03 49 Search for files or documents and Settings 07 03 2005 00 02 folders C3Inetpub 14 09 20
34. int float double A Cy Table 1 VRML Date type VRML Field Type SFField Data Type MFField P fon Data Type SF MF Int32 Numeric Python int array SF MF Float Numeric Python double array SF MF String string interpreted as UTF 8 list of strings unicode Cindy Yung 23 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report SF MF Time float time module float Numeric Python double array Ss ara einer SF MF Vec2f 2 item Numeric Python x 2 Numeric Python double double array array 3 item Numeric Python x 3 Numeric Python double double array array 4 item Numeric Python x 4 Numeric Python double double array array P N v 4 3 3 Text outp jifito a text file Buffered Reader Each read request is m 7x Reader A Reader creates a corresponding read request to be added on th ing character or byte stream In this case BufferedReader cab warp any Reader whose read operations could be costly such as FileReaders and Lo Example C BufferedReader in new BufferedReader new FileReadey name 4 3 4 Java lO class M File reader is used for input of character data from a e The input file can be an ordinary ASCLL one byte per character text file A Ref jean automatically translates the characters from the disk file format into the mf characters format The character in the input file might be from other alphabets G
35. loop OF put readLine null contents ap ine contents appe em getProperty line separator j catch ded Y ex ex printStackTrace catch IOException ex ex printStackTrace j finally try if input null flush and close both input and its yg feflying FileReader input close j K catch IOException ex ex printStackTrace Q i 7 PS return contents toString private static String replace final String alnput final String e rn final String aNewPattern return alnput replaceAll aOldPattern aNewPattern calInitial private static double calInitialVa double x double y double z double dist 0 00 dist x Math cos y 57 296 Math cos z 57 296 1 Q return dist private static double calInitialVb double x double y 1 return x Math sin y 57 296 Cindy Yung 85 U o Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report j private static double calInitialVc double x double y double z 1 return x Math sin z 57 296 Math cos y 57 296 j C double calV double VA double VB double VC M sqrt VA VA VB VB VC VC 7 j private itty ble calAlpha double SideSpin double BackSpin 1 return Math ata Spin BackSpin j private static doubl o VA double VB double VC double V double Alpha 3k return VA 0 0019 V
36. new JLabel Please select a Golf C Sou ControlPanel add golfSelection O set up JComboBox and register its event handler Ia ControlPanel setLayout new GridLayout 7 7 5 0 golfChoiceBox new JComboBox golfCourseNames On golfChoiceBox setMaximumRowCount 3 golfChoiceBox addItemListener S new ItemListener handle JComboBox event i public void itemStateChanged ItemEvent event determine whether check box selected Q if event getStateChange ItemEvent SELECTED golfSelection setIcon icons golfChoiceBox getSelectedIndex golfCourseChoice golfChoiceBox getSelectedIndex y end call to addItemListener ControlPanel add golfChoiceBox Cindy Yung 8l U o Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report ControlPanel setLayout new GridLayout 7 7 5 0 set up Jlabel tp display Imagelcons golfSelection new JLabel icons 0 ControlPanel add golfSelection setSize 350 100 setVisible true el setLayout new GridLayout 8 8 5 0 er new JButton Enter Ping y alco eee ActionListener public void Od erformed ActionEvent ae double text ble valueOf vall getText trim doubleValue double Nel ble valueOf val2 getText trim doubleValue double text3 Pie valveOvals getT ext trim doubleValue double text4 ivalueOf m backSpin getText trim doubleValue do
37. points for viewing ll worlds contain viewpoints but when they do you can use them Sr To activate a viewpoint m following Click the e horizontal toolbar or choose viewpoints from the pop up meftu and then select a viewpoint from the list of the predefined viewpoints e Click the arrow buttons to move to th previous viewpoint You can also press Page Down or Page Down ke AS Note If there are no predefined viewpoints in a world the om appears Moving around Walk Fly and Study DA L K There are three main navigation modes that Cortona VRML Client offe FLY and EXAMINE You can switch the navigation mode by clicking ifie on the vertical toolbar click STUDY to enter EXAMINE mode Each navigation Qoo have several options PLAN PAN TURN and ROLL The combination of navigation mode and its option determines the possible camera motion and its orientation Please note that the VRML author has an opportunity to specify which navigation paradigm should be used in the scene by default Some worlds don t allow Cindy Yung 104 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report the user to use navigation controls but they may provide on screen cues to navigation You can navigate with the mouse the keyboard or both mouse and keyboard To Cz 3D world using the mouse l a navigation mode 2 Posjs nglfe pointer anywhere in the
38. yaffa avt GridLayout import j Swing Icon import jav a4 2j Button I import java JComboBox import javax s rame import javax swin el import javax swing J Pgftel import javax swing ld public class GolfInput A Fields private JButton buttonEnter private JPanel ControlPanel private JPanel BottomPanel private JLabel valLabel private JLabel val2abel z private JLabel val3label private JLabel m backSpinLabel private JLabel m sideSpinLabel private JLabel Version private JLabel golfSelection private JTextField vall Q private JTextField val2 private JTextField val3 PS private JTextField m_backSpin A private JTextField m_sideSpin private JComboBox golfChoiceBox O private GridLayout grid Ia private String golfCourseNames private Icon icons On private int golfCourseChoice AY Constructors public GolfInput Methods private void jbInit throws Exception Q public static void main String args Cindy Yung BSc BEng Final Year Project Report 88 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report Source code Golflnput 1 class JBuilder API Decompiler stub source generated from class file 21 Apr 2006 implementation of methods is not available Imgfprts event ItemEvent Ee alapa class 1 imp OA ItemListener Constructors
39. 0 2 VC Alpha VB private static double calVb fo0uble VA double VB double V return VB 0 98 0 0019 V 0 25 o7 A private static double calVc double VA doubl double V double Alpha 1 return VC 0 0019 V 0 25 VC 0 2 V A AIpRBff j j Q Ose O KG 4 Zr Q Cindy Yung 86 ud Department of Electronic Communication and Electrical Engineering BSc BEng Final Year Project Report c BEng Final Year Project Repo University of Hertfordshire Implemented structure of Golflnput class Q Structure ox m gma ee amp Imports 55 java awt GridLayout 5 javax swing Icon 3 javax swing JButton 5 9 javax swing JComboBox 9p 0 89 javax swing JFrame p f javax swing JLabel i Ie TS javax swing JPanel i 3 javax swing JTextField di Goltinput 4 amp JFrame d Golflnput d main String args amp jblnit BottomPanel buttonEnter ControlPanel golf ChoiceBox golfCourseChoice golfCourseNames golfSelection arid1 icons m backSpin m backSpinLabel m sideSpin m sideSpinLabel vall val2 val2abel val3 val3label valLabel Version Cindy Yung 87 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire Source code Golflnput class JBuilder API Decompiler stub source generated from class file 21 Apr 2006 ympleggentation of methods is not available Imibrts import
40. 05 14 34 Cj2sdk1 4 2 10 View 30 11 2005 03 37 30 11 2005 04 36 20 03 2005 14 51 16 03 2006 14 39 12 03 2006 23 02 20 03 2006 21 05 wuTemp Undo Move Ctrl4Z 11 11 2005 19 49 5 xtvylh dwz 07 12 2005 21 37 sal L e801 Track o1 spd 20 04 2005 19 16 55 ahogyt uku Properties 07 12 2005 21 40 i My Computer 01 Track O1 wav io File 20 04 2005 18 40 B wo a A indo wav 3 755KB WAVE Audio File 20 04 2005 19 36 oa shared iTrip xml 64KB XML Document 03 08 2005 13 31 3 My Network Places File and Folder Tasks avaz pem 3MsOCache Make a new folder Program Files Publish this folder to Temp Paste the Web winpows Paste sa Refresh yagan vis Figure 7 Paste Fyp folder into C Cindy Yung 100 U Department of Electronic Communication and Electrical Engineering BSc BEng Final Year Project R University of Hertfordshire iN a ie ial te Now the Fyp folder is pasted in C you are ready to run the application Open Command Prompt which is located on Start Run Type emd in the text field Figure 8 and seclect OK button C Run Ax Type the name of a program folder document or Internet resource and Windows will open it for you Open and v po cmd into text field Command Prompt should had appe Type the following in Command P ot skip ahead cd Press Enter Figure 9 cd fyp versions Press Enter Figure 10
41. 2 ZL University of Hertfordshire Q BACHELOR Of CE DEGREE DEGREE WITH HONOURS IN I IMEDIA TECHNOLOGY Sify ear Project Report Department of Electronic Communication and Electrical Engineering O 3 Dimensional Display of th ajectory of a Golf Ball Report Q Cindy i Supervisor Fg Mr David Lee O A Date April 2006 Gx A Q DECLARATION STATEMENT I certify that the work submitted is my own and that any material derived or quoted from published or unpublished work of other persons has been duly acknowledged re amp UPBAAS C 6 1 Appendix I Section 2 Section on cheating and plagiarism Student M e Cindy Yung Student Regist Number 02041627 x Date 07 June 2006 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report ABSTRACT This report is part of a set of projects for state of the art golf driving range Gop graphic is becoming more advance in our culture which can display sharp s animation movies interactive functions and many more y With 3 Dimefigional application most 3D applications had pre defined view point or This report will iis How high level such languages as VRML and Java can interact with each other allwwing freedom restriction to change the outcome result of a Golf Ball trajectory in a 3 movement ional environment O Oe O KG Cindy Yung i U De
42. 25 0 n orientation 0 947 10 6 0 068 0 80 n description click n n n DEF ROOT Group n children n n Transform Mn children n DEF BOX Transform n translation 4 0 5 0 n children n Shape n appearance Appearance material Material n geometry Sphere radius 0 5 n n n n n H n Transform n children n Transform rotation 0 1 0 628 Cindy Yung BSc BEng Final Year Project Report U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report children USE BOX n n n n n Transform n children n Transform n rotation O 1 0 1 256 n children USE BOX n n n b n n Transform n children n Transform n rotation O 1 0 1 885 n children USE BOX n n wh wh n Transform n children n Transform n rotation 0 1 0 2 513 n children USE BOX n n n n Shape n appearance Appearance material Material diffuseColor 0 0 1 0 geometry Box size 400 0 1 50 n n n n n n n n Transform n translation 3 5 0 n children n DEF TOUCH TouchSensor n Shape n appearance Appearance material Material geometry Sphere radius 25 n n n n DEF TIME TimeSensor n
43. 3D window and press the left mouse button 3 Move the ey while holding down its left button The direction in which t pse determines the camera motion 4 Release the leig button to stop moving Note The distance that the mouse determines the speed with which the camera moves If you stop ing the mouse the camera will continue moving until you release the mouse button To the camera s movement or rotation press SHIFT CTRL or SHIFT CTRL di Use WALK PLAN to move in a horizontal plane t Forward move closer Ox A On y you drag Backward move further e Right turn to the right P Left turn to the left Note Move the mouse forward or backward while holding down the Space Q turn upward downward Move the mouse left or right while holding down the ALT key to move left or right Cindy Yung 105 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire and Use WALK PAN to move left or right in a horizontal plane tT Foryfard move closer d move further gt Right right Left move Q Note When you movi ura right or left the world will appear to move in the opposite direction 2 and Q Use WALK TURN to change the anglgf the camera in a world e Forward turn upward BSc BEng Final Year Project Report ub e Backward turn downward S Right turn to the right Oe A On ep Left turn to the left
44. 6000 090090202029 amp E E E E E E E E E E E E Ev ED v gt 46 Structure of GolfInput class Firble class JBuilder API Decompiler stub sourd ed from class file 21 Apr 2006 implementation of methods is not availgyfe public class ReadWriteFile Fields private double preValA private double preValB Q Source code Read private double preValC private int golfCourseChoice Constructors public ReadWriteFile Ox public ReadWriteFile double val double val2 double vaf3 le val4 double val5 int val6 O Methods A private void setContent double speed double vAngle double Tig Val double backSpin double sideSpin private String getContents return null private static String replace String aInput String aOldPattern String eo rn return null private static double calInitialVa double x double y double z return 0 private static double calInitialVb double x double y return 0 0 private static double calInitialVc double x double y double z return 0 0 private static double calV double VA double VB double VC return 0 0 Q private static double calAlpha double SideSpin double BackSpin return 0 03 private static double calVa double VA double VB double VC double V double Alpha return 0 0 private static double calVb double VA double VB double V return 0 0 private static double calVc double VA double V
45. AC3D is a relatively easy program to use which supports many 3D file formats including e POV Ray e VRML Cindy Yung 33 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report e RenderMan e 3D Studio e Lightwave e MD2 a ke BSP e Dis ctX and many more 4 11 3 2 stePad e NotePad is a si ext editor program which contains many file format extensions such as html e jsp wrl java php xsl and many more 4 12 Implementation af VRML golf course In this implementation M e should contain the following interactive touch sensor on a golf ball smoo Ation a refresh button inside the scene a realistic 3D golf course and a predefined co of golf ball trajectory in VRML term the KayValues coordinate points 4 12 1 Sample section of the 3D olf course The syntax below is used to define an object s grass which can be re used through out the VRML scene without re enter a code Line no fbgsffiption 1 RME Mader must be written in the first line of the e lared as a VRML file g fimition specifies the name for the new node i VRML V2 0 utf8 2 PROTO shortgrass 3 4 exposedField SFString type name Plane01 5 exposedField SFNode object site NULL 6 exposedField SFInt32 runtime mode 0 7 exposedField SFNode texture ImageTexture 8 9 url images GreenGrass02 jpg 10 11 field SFFloat _version_ 1 12 13
46. C double V double Alpha return 0 0 Cindy Yung 90 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report Appendix D Screen Shots of all VRML Golf courses Golf Coyrse 01 Tee low view point Gener me tog your shot liia Tee high view point Ficus TETI Golf c course e01 Tee high TE p Bird eye view Note the golf course view is Stated 90 degrees tom the original Q above Figure 49 Golf course 01 Bird eye view Cindy Yung 91 U Department of Electronic Communication and Electrical Engineering BSc BEng Final Year Project Report University of Hertfordshire Golf Course 02 Tee low view point Q gt 9 Se Golf course 02 Tee low view X Tee high view point x ry Figure 51 Golf course 02 Tee h Bird eye view Note the golf course view is rotated 90 degrees rem the original viewpoint above Figure 52 Golf course 02 Bird eye view Cindy Yung 92 U Department of Electronic Communication and Electrical Engineering BSc BEng Final Year Project Report University of Hertfordshire Golf Course 03 Tee low view point Tee high view point Bird eye view Note the golf course view is rotated 90 degrees 76m the original Viewpoint above Figure 55 Golf course 03 Bird eye view Cindy Yung 93 Department of Electronic Communicatio
47. History of golf ball http www thedesignshop com history htm http library thinkquest org 10556 english high history hist05 htm Brief history of golf http Mwwwyfenerifegolfholidays co uk About 020Golf htm Find The it Ball For Your Game m M ES Golf Ball http fiden 2 phys arg 1 fall2002 web dir josh fritts ball html Golf Cy http searchwarp com swa42729 htm http www napit co uk viewus inf http www tourcanada com golfhist Golf Course http www martindalecenter com Calculator port html http www ecs syr edu centers simfluid red go I http www ecs syr edu centers simfluid red golf_exp http www ecs syr edu centers simfluid red golf top M c uc m 825 amp isnumber 387 8 http www fxgolf com OTHER fxgolftips asp C http www fxgolf com Screenshot screenshot asp http www horsepowergolf com TourVanSchedule asp 4A hg http www freepatentsonline com 5390927 html CA http www franklygolf com Speak aerodynamics asp Q http www franklygolf com Speak QA ball test asp http sun4a vaniercollege qc ca golf Instruction html http sun4a vaniercollege qc ca golf index html http www tourcanada com golfhist htm Cindy Yung 52 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report http www coursemaster net About asp http www coursemaster net ProductsNavigator asp http www coursemaster net Products3 DGuides
48. Player collect golf ball from a ball dispenser The I D balls are automatically allocated to the players as the balls are dispensed Step2 Players register their ball in the bay to begin the game Step 3 Aim for selected target and strike ball from the mat jective score as many points as possible More points are awarded for tar rther away and nearer to the centre target Step 5 y on target and passes through the I D sensor her Step 6 T instantly shows on display showing distance the ball carried where is land he number of point achieved Step 7 End of g tal scores of each player will be displayed and automatically uploaded to Game tredeader board Figure 10 On the Left the out field of Top Ar 1a put and On the Right David Lee taking a shot in ope 2 7 2 Sports coach Os http www sports coach com index aspx 4A A Sport coach is a Golf simulator centre providing the latest golf simulationgfffere is one of the simulator Sport coach support Q LS Golf 3 Simulator Microsoft has taken many years to develop to give golfers the realism they have demanded from playing indoor golf Improved graphics sound effects course settings and weather settings makes the LS Golf 3 a true test for any Cindy Yung 18 U o Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report golfer whatever their handicap Using their own clubs a
49. Pleae enter Right left deg ControlPanel add val3label ControlPanel setLayout new GridLayout 4 4 5 0 val3 new JTextField 10 ControlPanel add val3 ControlPanel setLayout new GridLayout 5 5 5 0 buttonEnter new JButton Enter buttonEnter addActionListener new ActionListener 1 public void actionPerformed ActionEvent ae dispose double text Double valueOf vali getText trim doubleValue double text2 Double valueOf val2 getText trim doubleValue double text3 Double valueOf val3 getText trim doubleValue new ReadWriteFile text text2 text3 35 ControlPanel add buttonEnter BottomPanel new JPanel BottomPanel setLayout new GridLayout 1 1 Version new JLabel Version 0 1 Created by Cindy Yung BottomPanel add Version container add TopPanel container add ControlPanel container add BottomPanel setSize 450 270 Dimension screen Toolkit getDefaultToolkit getScreenSize int x screen width 450 2 int y screen height 270 2 setLocation x y setVisible true try 1 jbInit catch Exception e e printStackTrace public static void main String args GolfInput application new GolfInput application setDefaultCloseOperation JFrame EXIT_ON_CLOSE private void jbInit throws Exception Cindy Yung 64 U Department of Electronic Communication and Electrical Engineering University of Hertford
50. aad I D A 5 Figure 3 Right Hand ROG uos eoo coord eot one kb danade ant ust on ied np 6 Figuras RishtsHand Rule for rotation sans incor tench te deti eoa ria OR ARE 6 Fi D Baselirie ecce tcs dons Sav ay aeta Mave wets Sd aos 9 Fig pical Java enV ronment serseri uoo Ua aan Ran DE UR RIA A VAR IESER AE 11 Figure gf ES OP GIOIPBAIL E ossceeor on ntes s DE GM EM a 15 Figure 8 91 Trajectory OP ASCIOIF Ballets cstcce state hacckh caeca n det ies sbe Do Ub a 16 Figure 9 es Ramee Ot A Golf Ball ete batten iiair iain RS ROS Nea eun NOR 17 Figure 10 eft the out field of TopGolf layout and sssssssssss 18 Figure 11 LS STAA La ENKO sos se te e e ome DE dpt vee a race eR 19 Figure 12 Con initi l applications essnee oec cde a Decet us 23 Figure 13 Java IO las Figure 14 Figure 15 Figure 16 Figure 17 Figure 18 Figure 22 Figure 23 Figure 24 Figure 25 Figure 26 Figure 27 Figure 28 Figure 29 Figure 30 Figure 31 Figure 32 Figure 33 Figure 34 FileWriter hierarchy 14 eb JETER NEED Meu aaniehes 38 Figure 35 Sample section of application version 3 ReadyfiteFile java 39 Figure 37 Java3D example from Mac OSX p taut dos a ala 55 Figure 38 VRML example static seeeeeeeeeeeeeeeee t F Figure 39 VRML example Animated eee Ee Reate Figure 40 X3D Animated robot ess IT Fig
51. ader and browser e Java 3D support a number of interesting devices such as wands data gloves and headsets Cindy Yung 12 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report e Java 3D is optimized for speed where possible The runtime uses rendering capability bits in fact to optimize the scene graph for the faster possible renders this approach makes Java 3D more applicable to interactive graphics environments Games simulations low latency situations than to offline i amp h quality graphics applications like render farms 6 2 5 3 Redsarace As seen from ab advantages of Java 3D so what are the disadvantages e Java 3D is ast ane API that mean programmers have to keep up to date with the a 1t changes to the core platform e Java 3D had severe ay ity constraints Look at OpenGL can be run on every type of operating syst ture cross platform on Java 3D could be a problem e Java 3D hides rendering pipelingUetails from the developer Because Java 3D is a high level API it intentionally bg s details of the rendering pipeline from the developer which makes it unsuitabl for a significant number of problems where such details are important 6 Q 2 6 Brief history of Golf O The very beginning of golf started in 1400 s arguably in scott on the game itself was so popular 1457 that the King James II persuaded the un to ban it T
52. al Year Project Report B tlet Replace noie et say td ute E ees codec hana ua See m ste feces UE 53 Read And Write A PIS e eet deti ndi ausis a tts e deas a ug exi E RI di Ren d UG 54 String BULleti au e des ir i cess haee qui D RUD URN quamus nq I EE 54 Howto Use File Streams o toro bao eec d bdo ico e tease eo a det doa 54 Read a file and print using BufferedReader and System out 54 Reading Numbers from a Text File Line by Line eeeene 54 EP od MNT MO E E EE 54 ght ded RUS ce cto en pratt Giese endian ER ee eae EU Gc OR au 54 A IES MEC REN 55 APPEN AS on a EE EE E 55 Frame po ngu RT 55 DAVES cc 35 VRML 2 ffi M cts cites iie i e oe b ea e vus qi PIER RU ae bei edet 56 XSD sc M deseas dotted tute BA E ui ence deu ctus dus edes 56 X3D Source Mee dtc shoe fae ll a SL E 57 Appendix B XM 9 m 58 Implementation of GK Versions 592 cts eese serie arse ap eee eee Oe 58 Version 1 Initial agio io ee ah etes Pan edeq aie se eae 58 Version 1 GolfInputj Ulce CODE oo atas pie epe aoa sla abo E IOg das 58 Version 1 ReadWriteFile javas amp gurce code sse 59 Version ReadWriteFile j De Codere etos reos e a e eae 60 VEISIOD2 APP CATION mes Aea eters A R E cents dame OS 62 Version 2 GolfInput java SoA a elude ess veis d E DU EIS Ove 63 Version 2 ReadWriteFile java Source g de eeesssssssseeeeeen 65 Version 3
53. all featutied r thread wound around a solid rubber core The popular bramble mesh reverse _ a great many other patterns gradually gave way to the aerodyna Ou uperior dimple pattern first used in 1908 7 The Modern Ball ability and precision of today s ball reflect not only the tremendous technolafficaLgdvancement of their manufacture but also the development of space age plastics sWi igi improved rubber 7 The image below show th the golf ball in the following order left to right Feathery cube The Gutta Percha O Hammered Gutta The Bramble The Rubber Ball and The Modern Ball Ap Figure 7 Stages o 2 6 2 Standard weight of Golf Ball CM Oe O In 1932 the standardization of golf ball weight and size was C by the United States Golf Assn USGA QD The standardization of golf ball is as follows ps 1 Weight 1 620 ounces avoirdupois 45 93 gm A 2 Size the diameter should not be less than 1 680 inches 42 67 mm Q 3 Spherical Symmetry The ball must not be designed manufactured or intentionally modified to have properties which differ from those of a spherically symmetric ball Cindy Yung 15 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 4 Initial Velocity Should not exceed the limit specified by USGA when measured on apparatus 5 Overall Distance Standard Golf ball should not exceed the di
54. avatarSize field of the NavigationInfo node According to i L specification the first three values are Oa the avatar dimensions while additi Qs may be used for browser specific purposes In Cortona VRML Client thesfourth fifth and sixth values specify the center of scene rotation in the world coordinates XY and Z Q Use GOTO to move close to object in a world SECO the toolbar and then click on an object in the world You ll move directly to C Restore Fit and Align Cortona VRML Client provides three mechanisms that can help Ny a camera if you have lost your way in a world Unlike the navigation tools t An invoke predefined actions that take place as you click on them ps Q E Use RESTORE to automatically return to the loaded world s original active viewpoint Cindy Yung 109 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire Use FIT to make the scene view fully visible in the Cortona VRML Client 3D BSc BEng Final Year Project Report window ex Use NIE position the camera s horizontal and longitudinal axes parallel to the scene norisa lane Using Keyboaff pr Navigating You can control the ca x keyboard commands The functionality for buttons corresponds to the move A our mouse and depends on the navigation type its option and the specified 5 n note that the following description of keyboard commands is presented for the FL naviga
55. ayGolf lindsayGolf web lindsayGolf web billboard to launch its web sites site launched ina site launched in a a new window new window new window Golf bag replayed Golf bag replayed to replay your shot the simulation the simulation e simulation the simulation as the simulation as planned planned The 7 predefined The 7 predefined viewpoints viewpoints displayed displayed golf course golf course automatically automatically automatically adjusts to adjusted to the adjusted to the browser size browser size browser size 17 View Golf wrl in FireFox with g Golf wrl opened Golf wrl opened T ParalleGraphics Cortona plug in 5 5 Summary Q Overall the test results are very ideal as most of th oe found out to be positive except two minor issues O Issue 1 In the interface when values are not inserted CE fields before All VRML All VRML Z browser functions browser functions interacted with interacted with submission the application can not receive the input d text field is empty Fix 1 What should appear on the interface should be an instructigff putting on top Please insert values into ALL text fields in order to procee pf Issue 2 In the interface when value 0 is inserted in the text field the result is submitted but it failed to launch the Golf wrl file This is because there is no value to be calculated and inserted into KeyValue Cindy Yung 44 U Department of Electronic Commu
56. ayout new GridLayout 3 3 5 0 val2abel new JLabel Pleae enter a value 2 ControlPanel add val2abel ControlPanel setLayout new GridLayout 3 3 5 0 val2 new JTextField 10 ControlPanel add val2 ControlPanel setLayout new GridLayout 4 4 5 0 buttonEnter new JButton Enter buttonEnter addActionListener new ActionListener public void actionPerformed ActionEvent ae dispose int text Integer parseInt val1 getText int text2 Integer parseInt val2 getText new ReadWriteFile text text2 35 ControlPanel add buttonEnter BottomPanel new JPanel BottomPanel setLayout new GridLayout 1 1 Version new JLabel Version 0 1 Created by Cindy Yung BottomPanel add Version container add TopPanel container add ControlPanel container add BottomPanel setSize 450 270 Dimension screen Toolkit getDefaultToolkit getScreenSize int x screen width 450 2 int y screen height 270 2 setLocation x y setVisible true try 1 jbInit catch Exception e 4 e printStackTrace 3 Main class of the program create an instance of the ImageProcessingMain class public static void main String args GolfInput application new GolfInput application setDefaultCloseOperation JFrame EXIT_ON_CLOSE private void jbInit throws Exception Cindy Yung 59 Department of Electronic Communication and Electrical Engineering l j Universi
57. ber The arctangent is the angle whose tangent is number The returned angle is given in radians in the range it m Q t0 4 9 plementation of the design version 3 Due ous implementation of version 2 which didn t use all the formulas that were naif on dhe spreadsheet as a result the outcome was unsuccessful Using version 2 fy E the improvement of version 3 includes the following fields will be implemented into the interface In total there are Q Speed m s Vertical angle deg Right left deg Blackspin Si revs sec an e Twoe five text in revs sec e The additional S be implemented into the Java application 8 e A new wrl file to b geufrated wrl is extension of VRML e The outcome effect stfould be a smooth curve of the golf ball trajectory 4 9 1 Sample section of ap n version 3 The sample section below shows the p ad ormulas added into Java private static double calV double VA double VB double VC initial calculation vA callnitialVa speed vAngle rightLeftVal return Math sqrt VA VA VB VB VC VC vB callnitial Vb speed vAngle vC callnitialVc speed vAngle rightLeftVal alpha calAlpha sideSpin backSpin private static double calAlpha double SideSpin double BackSpin 1 for int i 0 i lt 100 i return Math atan SideSpin BackSpin i if i 0 private static double calVa double VA double VB double VC double V if height lt 0 double Alpha vA 0 0 return
58. chieve the highest quality in 9 view of th Pion 3 2 ne irements For best view of C eio user are advised to follow the specification below to receive smooth running Yc application 3 2 1 Hardware L e Operating system Microso bws 98 ME 2000 XP or Windows NT 4 0 e Processor Pentium r 90 M e Random Access Memory RAM mipifftum of 128 MB T ter processor e Display SVGA 256 colour The 800x600Migh colour mode is recommended e Graphic card that support OpenGL or DS e Input devices Mouse and keyboard j ii 3 2 2 Software O e Internet Explorer 5 0 or a later version Netscape oA or a later version Mozilla 1 5 or a later version or Opera 7 0 or a ero e VRML browser can be downloaded free on A http www parallelgraphics com products cortona download i E e Java 2 Platform Standard Edition J2SE can be downloaded free On http java sun com j2se 1 5 0 download jsp Q Cindy Yung 20 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 3 3 Developer Requirements To achieve the best outcome for this project the following languages software and hardware are needed to create this application aO s Lo ud Development Kit J2SDK Py 2 0 3 3 2 sone e TextPad Q gater version e VrmlPad 2 1 0 r version e NotePad 5 1 ora y e Borland JBuilder bs sae version e AC3D 5 0 or a later version e 3D studio Max
59. cifications vrml VRML 1 0 f http www web3d org x3d specifications vrml VRML 0 index html VRML Browsers http www web3d org x3d vrml tools viewers and browsers Cindy Yung 50 U Department of Electronic Communication and Electrical Engineering BSc BEng Final Year Project Report University of Hertfordshire VRML 97 Spec http tecfa unige ch guides vrml vrml97 spec VRML 2 0 Vs X3D web3d org x3d x3d vs vrml html TAX ac http ww pA uk train vrml2rep part1 guide3 htm MICROSO Or If Statement In d http pubs logicalexpre Og aaa aa http personal computer t 2 ENS Atan Excel http www greytrout com manuals uide node43 html http www techonthenet com excel forfnulas atan php Sqrt Excel http www techonthenet com excel formulas s Maths Euler s Method Golf Ball Oe http www math ubc ca feldman demos demo1 html O id ew seers eu eee sumo scm OO Gi euler html onan e a qm Y RA htp www math montana edu fankw cep calculus des euler forup Xo y htm http director online com buildArticle php id 346 http www rose hulman edu millerts Classes code i20descripiion A http mathworld wolfram com EulerForwardMethod html Q Golf Information Dimples Vs Smooth Golf Ball http wings avkids com Book Sports instructor golf 01 html Cindy Yung 5 U Department of Electronic Communication and Electrical Engineering BSc BEng Final Year Project Report University of Hertfordshire
60. close catch IOException e j j j Figure 14 Sample section initial application Read Wri java 4 4 2 Summary of initial application Cy The outcome of the application was successful The outcome stages are fuf 1 Java read the VRML file which is imbedded within itself 2 Using the Java interface users are requested to input two values XY axis as they wishes 3 The values would then be collected and print to be generated in a new file called Golf wrl Cindy Yung 25 Department of Electronic Communication and Electrical Engineering U University of Hertfordshire BSc BEng Final Year Project Report 4 Open Golf wrl at the specific location to display the outcome effect 5 Re enter values on the interface and press refresh on the Internet browser to display new results As shof this application is to prove the concept With VRML imbedded inside java java tnterfag calls for the value change and displays the outcome result in VRML Screen oy the initial application are placed in Appendix B 4 5 Deci f what language to use After a successfulimglementation decision is made to select the languages VRML Ee and Java as being p chy languages work well with each other which will also e be using the tested stru apter 4 2 5 to build the final product The design structure is shown in Figure Values collection Interface Java Write VRML code to Submit text file
61. ctory createTitledBorder Golf Value Q ControlPanel setBorder ControlPanelBorder valLabel new JLabel Please enter Speed m s ControlPanel add valLabel ControlPanel setLayout new GridLayout 2 2 5 0 vall new JTextField 10 ControlPanel add val1 Cindy Yung 80 U Department of Electronic Communication and Electrical Engineering A Fi ject Report University of Hertfordshire BERUBEDR Final veat Project Repo ControlPanel setLayout new GridLayout 3 3 5 0 val2abel new JLabel Please enter Vertical angle deg ControlPanel add val2abel ControlPanel setLayout new GridLayout 3 3 5 0 val2 new JTextField 10 CggftrolPanel add val2 nel setLayout new GridLayout 4 4 5 0 valel Znew JLabel Please enter Right left deg Contro fad val3label ControlPa ayout new GridLayout 4 4 5 0 val3 new JT teld 10 ControlPanel B ControlPanel setLay w GridLayout 5 5 5 0 m backSpinLabel d el Please enter Backspin revs sec ControlPanel add m abel Epi racione BUM fm ayout 5 5 5 0 m backSpin new JTextPield 10 ControlPanel add m backSpin ControlPanel setLayout new Gri A 5 0 m sideSpinLabel new JLabel Pleagg enter Sidespin revs sec ControlPanel add m sideSpinLabel ControlPanel setLayout new GridLayout 6 6 m sideSpin new JTextField 10 ControlPanel add m sideSpin ControlPanel setLayout new GridLayout 7 7 5 0 f QO golfSelection
62. d drop operation Retrieves Q ect s uniform resource locator URL of an object resource dragged t window Cindy Yung 112 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report Appendix H Questionnaire 1 What do you think of the overall simulation Ex Good Average Poor Others 2 What do think of the look and effect of the interface Excellen o Average Poor Others 3 Does the 3D g rse match up in the real world Yes No 4 How would you feefibiustryction is added in the interface Would this provide better usage Ww Yes No oe 5 By adding a background image ompany logo does it provide a professional look and identity True False 6 Is it easy to use the VRML browser fu ns ie navigate around the golf course Yes No Q 7 What do you think of the images used in the er course Excellent Good Average Poor ars 8 Are you happy with the simulation trajectory of a Il Yes No 9 Would you like to have more golf courses to choose inis Yes No 10 Would you like to access the simulator through the Internet Ye No Z Q Cindy Yung 113 uO University of Hertfordshire Questionnaire results Department of Electronic Communication and Electrical Engineering BSc BEng Final Year Project Report 1 What do you think of the overall simulation 0 4 ElExcellent BlGood LlAverage 4 7 OPoor H Others
63. d itself is not perfect Eric W Weisstein once said The accuracy is actually not too bad and the stabili rns out to be reasonable as long as the so called Courant Friedrichs Lewy is fulfilled 8 4 6 3 Concern on trajectory formulas Sf With the research above it proves that a lot of mathematical formulas pred to s of be constructed in order to build a successful simulation Due to lack of Mo tical knowledge in the area of physics trajectory pattern it leads to delay on the Q the project As a result Mr N Lindsay has provided an Excel spreadsheet containing the answer to the calculations From the spreadsheet the numbers in red are the input data from Cindy Yung 27 U Department of Electronic Communication and Electrical Engineering BSc BEng Final Year Project Report University of Hertfordshire the launch analyser figure 16 the output data formulas can be located on the first three columns starting from row 10 which will then be fed into the simulation A SR Fea e Se a eee ee S ee ee aa a l BL Golf Ball Trajectory _2 Columns A B and C row 10 onwards give the ball position in metres at 0 1 second intervals L3 Input data in col E Speed m s 55 00 4 Vertical angle deg 16 00 Always positive EN Rightleft deg 3 00 NB right is positive Backspin revs sec 60 00 Always positive EH Sidespin revs sec 20 00 NB hooking spin is positive 8 9 Distance Height Right le
64. dix G D User Manual cL This User manual assumes a di from the ReadMe htm which is located in the CD enclosed aji How to install and run 3D Golf Se Wil application The first thing you need to do is to download th igation file which is located below Please select a version Oe View from University u or View from Home W on file Please select Save button A new window will open up Figure 1 asking Do you want Ree this Za Cindy Yung 96 U Department of Electronic Communication and Electrical Engineering BSc BEng Final Year Project Report University of Hertfordshire Do you want to open or save this file Name Fyp zip Type WinZip File 3 01 MB From mmtprojects4 mmt herts ac uk 7 4 M Always ask before opening this type of file While files from the Intemet can be useful some files can potentially harm your computer If you do not trust the source do not open or save this file What s the risk o 1 Please select Save button Save Fyp zip file onto vefa 2 Save in E Desktop v Q eega my Documents xit2 website Ee 3 My Computer Recent Quy Network Places C3 3ds solar gt 3x2 website2 C3 ocs Desktop CQFYP New Golf VRML GF YP New Golf VRML2 t O fyp reseach e er upload ftp golfcourse My Documents Gjava lab test example er NorRTON AIO Gauss stick stuffs My Computer File name Fyp zip RJE M
65. dla R ed dr Ha 3 2 1 Earn Warte cueste soto tuc EE E O O E Cindy Yung BSc BEng Final Year Project Report Xii iii U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 3 212 ROLE WV AL Ger e e ated NER M DE S Nate d C iE 20 3 Developer REQuire ments 522 2 epe e uso eee dien aig eod aee duke odas 21 3 3 1 Languages sadi st ic UR ERN QU RA QUU EP qu S qu ars opi qud 21 3 3 2 Software eoa diae enu orabat pu oq a A A 21 3 3 3 bar ate ceat ce tended iets td a ii aa a aE a a ta ded 21 3 4 Mna 21 4 Meyebdolopy HrplementatlOTi eise erecta oan edd oa a tata toa e paa ela 22 TEOUUGUOD S tor ero RO RUN CE eo ar eis erra p Du vd a d ea C QU E tees 22 N ges in choosing the suitable Languages eseee 22 z Phe First language tested ose eo C oet quais e Dedi ute 22 he Second language tested us oce edicere ustedes aer ptus 22 d 2 s Third language Tested sce dose tae dpt a ha xta qa iugis chads 22 PATI Ss utes oq oe o eg ORE POR ES Cave ees 23 E 3 ound information on initial Implementation 23 4 3 2 ata PY DES esos See De oin Doe EN S a 23 4 3 3 Tex t i a text file Buffered Reader ssssssssss 24 4 3 4 java Rd S ees tg A oem i ala in tad lh ie nh E ate ee Mate 24 44 Implementati vixi d cide Ma uM e 25 4 4 1 Sample se fion Of initial application
66. double calInitialVa double x double y double z double dist 0 00 dist x Math cos y 57 296 Math cos z 57 296 return dist private static double calInitialVb double x double y return x Math sin y 57 296 H private static double calInitialVc double x double y double z return x Math sin z 57 296 Math cos y 57 296 private static double calV double VA double VB double VC return Math sqrt VA VA VB VB VC VC private static double calAlpha double SideSpin double BackSpin return Math atan SideSpin BackSpin 3 private static double calVa double VA double VB double VC double V double Alpha i return VA 0 0019 V 0 25 VA 0 2 VC Alpha VB private static double calVb double VA double VB double V return VB 0 98 0 0019 V 0 25 VB 0 2 VA private static double calVc double VA double VC double V double Alpha return VC 0 0019 V 0 25 VC 0 2 VA Alpha Cindy Yung 78 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report Appendix C Final application screen shot oe iy a t RE x Figure TIPAI application Source Code In this section the source code file will be sh ollows GolfInput java Interface Cx ReadWriteFile java the main program O Golfinput class Ia Golfinput 1 class On Golfinput 2 class ReadWriteFile class
67. e ue oce o tete dee cepe 43 Cindy Yung U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report List of Formula Formula 1 Method to solve for velocity at time t to At iiisiisueessessssssssn 27 Formula 2 Method for the components of position sssssssssseeeee 27 Formul 3 AOU 3 d soc thorinnn aee a E E ieat act ideas dutticenactelcatn cibus cox 28 Fo A Additional tormas asasan eaten oar ov e ada t aieo a ac tan 30 Cindy Yung xi U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report GLOSSARY Java compiler javac translates a Java program into bytecodes the language underg od by the Java interpreter If a program compiler produces a file with the class ext amp nsiongsthis is the file containing the bytecodes that are interpreted during the executi se 1 y A Java pro ust first be placed in memory before it can execute This is done by the class loade h takes the class file or files containing the bytecodes and transfers it to me The class file can be loaded from a disk on your system ir over a network 1 JA An application is a progra is normally stored and executed on the user s local computer Applications are loadedg emory then executed by the java interpreter 1 a An applet is a program that is normally stef d on
68. eRoute interp value changed root children root children length 1 set translation n n 7 n J Browser addRoute interp value changed root children i set translation n 7 i n i root children length n n n n v n n n ROUTE TOUCH isActive TO SCRIPT set val n System out printIn sb toString out write sb toString out close catch IOException e public static double calDistance double x double y double z double dist 0 00 dist x Math cos y 57 296 Math cos z 57 296 return dist H public static double calHeight double x double y double height 0 00 height x Math sin y 57 296 return height public static double calRightLeft double x double y double z double right 0 00 right x Math sin z 57 296 Math cos y 57 296 return right Cindy Yung 69 BSc BEng Final Year Project Report Department of Electronic Communication and Electrical Engineering University of Hertfordshire vi Version 3 application fun Apur Aq pajear O Z uos 18A 09 8i Ss ETE 2as SAa utdsapis 13443 aeaid 2 as saa1 udsy3eg 13 U3 aeaid Hap yayu 13443 aeaid fap afue jana 13 U3 aeatd sjui paads 13 u3 aseaid enigeA 409 andu jjo9 4 amp 5 UOISIOA uoneor dd y en 32ss IdIMOS OI 9 I392USI y Hua uaap Tys 37004 T UeAplTys 3004 pa
69. eeeenen 95 Figureg8 Insert values in all text fields on Golf course 01 Test on submission of S M Ng MR ONE 95 Fi Test if GolfTek billDoatd ODEfi ii oc petere aee vere aec deiade 95 Figure g Test if Lindsay Golf billboard open 96 Figure 61 Pce design Ol eus eo taka old Lt Le UU AE UE 116 Figure 62 um arace design 02 etd ttes ett e io e iret 116 Figure 63 I esi 03 aeo tele pup paulum edet oa OS 116 Figure 64 oA AI APAB m 117 Figure 65 Gol UNIS For PANIER Nc MUR MUERE UY 117 Figure 66 Golf c ramo mec E 117 Figure 67 Golf cour PM okies 117 Figure 68 Initial Gane TL sete cedit ix per ea dh x eta Dee xat EUR TA RANA teabivan 119 Cindy Yung ix Department of Electronic Communicati d Electrical Engi i x HO P p EDD E ME ETAR TIR BSc BEng Final Year Project Report University of Hertfordshire List of Tables Table Tt VRML Date ty pe i25 etait tette toa H4 UH9 I RAEI TSAARI OAEIAE AR eM 23 Table 2 Outcome results version 2 3 ara eic ade dr oi a ole gat P Puce ade 29 Table 5 Outcome results version 3 osos rta SIBI deba ed M epe i Doc pa cds 32 Tables Outcome results Final appliCationr o eni agre toast eire en ees ES 40 Talffe 5 Test result Application and Golf course 01 ssssssesee 41 Ta st result Application and Golf course 02 ssssssssseeee 42 Table Wat Application and Golf course 093
70. eet eis 39 4 14 4 Summary ofthe Final implementation eeeeeeeen 40 2 15 Summary 20e Canes eap ied ace Py etait lait qot enndem dee nda Pod ede ues Paseos od 40 Se Testing E eco uen sin attenuates a d A UA LA LC Pc A deacon 41 Cindy Yung iv U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 5 1 EgtrodUc IOI SAC eo de ak m Le ous Ine UE 41 5 2 Test result Application and Golf course 01 ssssses 41 5 3 Test result Application and Golf course 02 sse 42 5 4 Test result Application and Golf course 03 ssssssssssee 43 9 SUMMAT oe bod stus cba ne uam tema arabe n ecu ctu E Li 44 Meridie 45 RE INGES esa aan ocean ea d aeo aom abso dian odd aed dient 47 BI ldsp E 48 Usel SA For ei x 48 X3 ME ne iso aE e E d dE E M D EE Rian E S 49 Pus api MH od can disaden apne mee E na Plata eacod aan tuaed Ohaus 49 KBD Row sav ai sais casa cata tagy Contaassl aay cuss A Rain ada ae eR 49 Information Qe Eo SORA CE DE SPREE AE See E RE 49 http tecfa guides vrml vrmlman nodeS5 html Proto 49 VRML oe ar wile o t H 49 Xvrml Include a Rule isses di tn aed a ache sean dubai 49 Java 3d And Vrm VRML Eg Collision Node cums ssccccccssssscccsssssccccssssscccesssnccecessenacecesseaeesenseaaeees 50 Object To Object
71. eration of VRML 2 0 X3D in an Open Standards XML enabled 3D file format to enable real time tion of 3D data across all applications and network applications It has a rich res for use in engineering and scientific visualization CAD and Archit edical visualization Training and simulation multimedia 9 entertainm 2 and more 2 X3D is a conside ore mature and refined standard than its VRML predecessor so authors can achicygfffe behaviours they expect 2 2 3 5 X3D Baseline Cy A e Interchange is the basic profile limunicating between applications It support geometry texturing basic lightipgfand animation e Interactive enables basic interaction with environment by adding various sensor nodes for user navigation and interactiong e g PlanseSensor TouchSensor etc enhanced timing and additional lighting yer PointLight e Immersive enables full 3D graphics and n x audio support collision fog and scripting A e Full includes all defined nodes including NURBS Kiana GeoSpatial components 2 Figure 5 X3D Baseline Source web3d org Cindy Yung 9 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 2 4 History of Java Java wasgfteveloped by Sun Microsystems It operates on Java 2 Platform Standard Editi n callg the Java 2 Software Development Kit J2SDK version 1 4 1 which includes inimum se
72. esting 2 days Wed 15 02 06 Thu 16 02 06 Stage write up 1day Fri17 02 06 Fri 17 02 06 Implement trajectory formula from research 3wks Sat 18 02 06 Thu 09 03 06 into the 3D golf course programme Testing 2days Fri 10 03 06 Mon 13 03 06 Stage write up 1day Tue 1403 06 Tue 14 03 06 Testing 7 wks Wed 15 03 06 Tue 02 05 06 Final testing 3wks Wed 15 03 06 Tue 04 04 06 Final write up and presentation 1mon Wed 05 04 06 Tue 02 05 06 Figure 68 Initial Gantt Chart Cindy Yung 119 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report Final Project Time Plan Gantt Chart BIs siem eoo ee ESSE SESS Ee ECT EPIS a EPIS TEE EPIS es ESI ESTE a Project Title MS Ona 2p A ATTETTE Research various 3D language on their compatibility The main objective is to display the trajectory SSS ST L IJ Research into a zm eO P JAERRRRRR RR RR RR required Fest EH 1 Aly ge 7 used O TTT 4 May ie Analysis requireme ts OE HHS Application me TTT TTT COCO ASH T I EN A L LLLI ete et ET EEE findings Cindy Yung 120 BSc BEng Final Year Project Report Department of Electronic Communication and Electrical Engineering University of Hertfordshire uO 121 Cindy Yung U Qo De iid artment of Electronic Communication and Electrical Engineering rsity of Hertfords UN BSc BEng Final Year P
73. field of a shape 32 node 33 coord Coordinate 34 Geometry defines the object shape 35 point 2 specifies a node listing coordinates available for 36 building faces within face set emu e o m 38 0 0 272 7 268 1 0 0 268 1 0 272 7 geometr coordinates for a shape 40 N coordinates 41 51 We A 5 Ws V fl indicating faces in face set an unknown order 42 texCoord TextureCoordinate 43 Decifies list of coordinate indexes describing the 44 point 45 46 36 61 8 748 22 36 14 51 0 5 0 5 47 13 75 22 75 23 36 13 51 9 107 36 76 48 8 107 37 76 14 75 23 75 37 61 9 748 49 50 51 ccw FALSE 52 coordIndex Figure 21 Sample section of VRML golf course part 3 Cindy Yung 35 L J Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 4 12 2 Summary of VRML golf course The overall result was successful with fully integrated interactive scene smooth navigation interactive touch sensor on a golf ball a refresh button inside the scene a predetermined coordinate of golf ball trajectory and a realistic 3D golf course Cut features were added which included multiple view points and a preden s link to golftek com p3proswing com and lindsayputters com Mr N Lindsay FE of multiple view points are placed in Appendix E 4 13 Screen s of final VRML golf course The screen shots Mi the
74. ft Va Vb vc V alpha 10 0 00 0 00 0 00 52 80 15 16 2 77 55 00 0 32 11 5 28 1 52 0 28 51 12 14 89 2 34 53 29 0 32 12 10 39 3 00 0 51 49 54 14 57 1 95 51 67 0 32 13 15 35 446 0 71 48 05 14 20 1 59 50 13 0 32 14 20 15 5 88 0 86 46 64 13 80 1 25 48 66 0 32 15 24 81 7 26 0 99 45 32 13 36 0 95 47 26 0 32 16 29 35 8 60 1 08 44 07 12 90 0 66 45 92 0 32 i 33 75 9 89 1 15 42 88 1240 0 40 44 64 0 32 18 38 04 11 13 1 19 41 77 11 89 0 16 43 43 0 32 19 42 22 12 32 1 21 40 71 11 35 0 06 42 26 0 32 20 46 29 13 45 1 20 39 71 10 80 0 27 41 15 0 32 21 50 26 14 53 1 17 38 76 10 23 047 40 09 0 32 102 103 NOTES 104 Speed is in the range 20m s for a short chip to 75m s for a long drive 105 Long shots gt 60m s have usually less than 15 degrees of vertical angle 106 High lofted shots gt 20 degrees vertical angle usually have speeds of less than 50m s 107 Backspin is roughly proportional to the vertical angle 108 Assume Backspin 5 Speed sin E4 57 50 to 50 109 Sidespin can be positive hooking or negative slicing and usually less than 50 of backspin 210 111 nee c golf trajectory 4 6 4 Golf trajectory formulas These are the formulas gathered from the t which are shown in formula 3 Te The formulas will then be translated into Jav fA will be implemented into fim frm Pervious vole gt Va xBeos sano Booz 5596 application version 2 ReadWriteFile java Formula 3 O
75. fueyo angen daa ut aqnoyppe ae lt uotzeTsueaz 39s ee es d4a Zur aqnoyaQaT ap lt pobueys onpen SECETOS LEUI CEE E aE ECE LS i oo e Mac ELI MILES CN 4oesSno4g gt JOTIeST Sues 3 DECEM HONOL 31fo0H lt UOTQeTSURAQ 3 lt 2004 U9APT TY 3o0C ET r u94p tu2 30 70 Cindy Yung U Department of Electronic Communication and Electrical Engineering University of Hertfordshire Version 3 Golflnpt java Source code import java awt import java awt event import javax swing import javax swing border lt p gt Final Year Project Code lt p gt Main class to the image processing class give user choice to choose from either automatic or manual processing mode author Cindy Yung version 2 0 public class GolfInput extends JFrame IHHL INSTANCE VARIABLES T M NB IIT LTT private JButton buttonEnter private JPanel ControlPanel private JPanel BottomPanel private JLabel valLabel val2abel val3label m backSpinLabel m sideSpinLabel Version private JTextField vali val2 val3 m backSpin m sideSpin private GridLayout grid1 public GolfInput super Golf Input setting the GUI with windows feel WindowUtilities setNativeLookAndFeel grid1 new GridLayout 2 1 5 0 gridi new GridLayout 1 0 0 0 Container container getContentPane container setLayout grid1 Co
76. he reason behind this was King James II was worried thais gien were spending too much time playing golf and not enough on practising their skills The King felt that this would jeopardise Scotland in preparing to defend itse inst an English invasion The ban was reaffirmed in 1470 and 1491 even though y people largely ignored it Cindy Yung 13 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 2 6 1 History of Golf Ball When go ball was in place the game of golf needed to be changed such as develbpmendsef the golf club golf course and the rules of the game were all affected by the Go live fy Feathery cube l pieces of stout leather were tightly stitched leaving a small l evolution Here are the stages of how the modern golf ball comes to opening The casing f umed inside out Feathers a gentleman s top hat full by measure that had beef b ifed and softened were tediously stuffed into the casing before the final stitches w fe e The surprisingly hard feather ball was hammered into roundness and finally co ith several layers of paint Because of the difficulty and time involved they O expensive This fragile missile was used for almost four centuries 7 The Gutta Percha The first Gutta ball is b fieved to have been made in 1848 by the Rev Dr Robert Adams Paterson from guttapercha packing material Gutta percha is
77. ializeOnly MFNode children inputOutput SFTime startTime inputOutput SFTime stopTime initializeOnly SFBool loop ShuttlesAndPendulums x3dv Pendulum Viewpoint description Watch Robot position 0 0 150 DEF Near ProximitySensor size 200 200 200 DEF Walk Shuttle stopTime 1 rate 10 distance 20 children The Robot Transform rotation 0 1 0 1 57 children Shape appearance DEF A Appearance material Material diffuseColor 0 0 5 0 7 geometry Box head Transform scale 1 5 1 translation 0 5 0 children Shape 4 body appearance USE A geometry Sphere Transform rotation O 1 0 1 57 translation 1 5 0 children DEF Arm Pendulum stopTime 1 rate 1 maxAngle 0 52 30 degrees children Transform translation 0 3 0 children Shape appearance USE A geometry Cylinder height 4 radius 0 5 duplicate arm on other side and flip so it swings in opposition Transform rotation 0 1 0 1 57 translation 1 5 0 children USE Arm ROUTE Near enterTime TO Walk startTime ROUTE Near enterTime TO Arm startTime ROUTE Near exitTime TO Walk stopTime ROUTE Near exitTime TO Arm stopTime Figure 41 X3D example source code Cindy Yung 57 U Department of Electronic Communication and Electrical Engineering BSc BEng Final Year Project Report University of Hertfordshire Appendix B implementation of application versions 1 3 import java awt import java awt e
78. ication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report em World Wide Web with special VRML browsers that plug ins to the Web browsers VRML is well integrated with the WWW e g VRML scenes can be connected to any URLS VRML 2 0 is also known as VRML97 In comparison VRML97 contains numerous changes toJif VRML 1 0 Here A es e ag SM e Audio Q e Behaviour e Scripting d 7 In this cases VRML97 is be than VRML 1 0 To view VRML as mentioned it Qu browser plug ins to the web browser Here are a list of browsers that can be downloaded for Windows platforms ae Cosmo Player One of the more popular V CO although it is no longer being updated and is not being supported techn ompliant with VRML97 Openwrl VRML97 viewer with model s parts S separate objects importing one file to another Cortona VRML Client Works as a highly interactive Qe plug in for popular Internet browsers and office applications Complet 97 support including Java and JavaScript support hardware acceleration pic rendering automation interface iy FreeWRL An open source VRML and X3D browser written by a LA developers who wish to produce a high quality up to date browser MS public domain O S Mac Q Cindy Yung 8 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 2 3 4 X3D the next gen
79. ightLeft calRightLeft speed vAngle rightLeftVal double height 0 00 preValA preValA 0 1 distance preValB preValB height 0 1 preValC preValC rightLeft 0 1 height x Math sin y 57 296 return height j if i 99 sb append preValA preValB preValC n public static double calRightLeft double x double y double z else sb append preValA preValB preValC p t System out println Current Pos i distance preValA height preValB 1 double right 0 00 right x Math sin z 57 296 Math cos y 57 296 eturn right Right Left preValC Table 2 Outcome results version 2 Expected result Actual result A Java interface with three text fields Three text fields displayed including Speed m s Vertical deg and Speed m s Vertical deg Q Right left deg Right left deg Java application together with the trajectory Calculations are in place calculations New wrl file to be generated wrl is New VRML file called golf wrl was Cindy Yung 29 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report extension of VRML generated A VRML file golf wrl to display the Outcome effect displayed outcome effect The outcome effect should be a smooth curve Ball flied in a diagonal pattern of never e golf ball trajectory ending height no curve was d
80. igure 37 Java3D example from Mac OSX Cindy Yung 55 Department of Electronic Communication and Electrical Engineering HO Walvetsity af Hertfordshire BSc BEng Final Year Project Report VRML 2 0 In this VRML program it contains five sphere objects and a touch sensor When touch sensor is activated the first sphere will display a predefined animation Activate fouch sensor 2 time the first sphere will stop at current location and second sphe start ae predefined animation and so on Touch 2 Static Touch Animated sensor spheres sensor spheres Figure 38 VRML example static Figure 39 VRML example Animated X3D a X3D is the next generation of VRML 2 0 ffiis le is from web3d org 16 which shows an animated robot Q m wn da e U 226 P Pas Figure 40 X3D Animated robot 56 Cindy Yung U Department of Electronic Communication and Electrical Engineering University of Hertfordshire X3D Source code BSc BEng Final Year Project Report The source below shows that X3D is very similar to VRML X3D V3 0 utf8 PROFILE Immersive META filename Robot x3dv EXTERNPROTO Shuttle initializeOnly SFTime rate initializeOnly SFFloat distance initializeOnly MFNode children inputOutput SFTime startTime inputOutput SFTime stopTime initializeOnly SFBool loop ShuttlesAndPendulums x3dv Shuttle EXTERNPROTO Pendulum initializeOnly SFTime rate initializeOnly SFFloat maxAngle init
81. ion will display a predication vede p is going to land the angle PAN This simulation will be as realistic accurate as possible P cum is the of the ball and backspin or sidespin beginning plan of a major project for my client called Mr Nor ndsay He is an inventor who aim to build a golf course with gadget sensor imbetid 2 golf c course will be one of the most up to date in the world of never endi technology society CA Cindy Yung 1 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 1 2 Project Objectives The objegfive is to create an application that can predict where the ball is going to ea of the ball and backspin or sidespin Instead of the automated system io use the application to get the results needed for their shots after the shots have Gen For example users can input values on speed distance vertical angle in and sidespin Once users select to take the shots a 3D simulation will au flight and rotation of the golf ball 1 3 Restrictions While working on the project there a number of restrictions that delayed the process of the simulation The NM the following e Knowledge of programming languages VRML Having to learn the language this it will require a lot of research into its usage and functions This will take Q of time from the project in research and reading Java Would be the best
82. isplayed As seen PA 2 the overall outcome was unsuccessful To resolve the issue the S fg cking into the steps and then to work out what had gone wrong solution i Screen shots of Od ication version 2 are placed in Appendix B 4 8 Resolve erof n application version 2 After investigation a inl mula on row 11 has been found in the worksheet figure 16 Previously the rksheet was not checked as the formulas are assumed to be the same through ou rksheet Also by changing the input data the nygfber in red the entire worksheet will be dynamically updated with the results After the discovery the next step is to interpret Y ing into another design which r fect will show how the formulas can create a smooth t ec These are the additional formulas that were missed on applig ffiort version 2 Formula 4 Additional formulas AY SORT VAB VA VBB VB VCB VC A EN aray fim Backspin CA Q 4 8 1 Additional formulas b ceg b c VA VA 30 0019B VB 0 25B VA 2B VCBAlpha VB BIF Height lt 0 0 1 b x b c VB VB 0 98 0 0019B VB 025BVB Q02B VA BIF Height lt 0 0 1 d b ce b c VC VC 0 0019B VB 025B VC 0 2BVABAlpha BIF Height lt 0 0 1 SORT The SQRT function returns the square root of a number Cindy Yung 30 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report ATAN Returns the arctangent or inverse tangent of a num
83. istance distance 0 vA height height vB 0 1 rightLeft rightLeft vC 0 1 if i lt 99 sb append rightLeft height 4 distance n else sb append rightLeft height 4 stance n System out printIn Current Pos i sin distance height height Right Left rightLeft A Read the original VRML file until it reaches the line RE CODEHERE This is where the calculated data from the trajectory formulas rmplaced orignalFileContent getContents newContent replace orignalFileContent rREPLAcE CODE toString System out printIn newContent AY out write newContent out close pP catch IOException e t System out printIn Error in saving file e Q j private String getContents checks on Golftest are elided StringBuffer contents new StringBuffer declared here only to make visible to finally clause BufferedReader input null Cindy Yung 84 U o Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report try use buffering this implementation reads one line at a time FileReader always assumes default encoding is OK if golfCourseChoice 0 input new BufferedReader new FileReader C FYP version5 golf1_V13 wrl else if golfCourseChoice 1 j ff not declared within while
84. language for mee culation of the golf ball With my knowledge of Java at a beginner level it wq ld ave negative impact on the time required to get the standard necessary for this ec e To create a simulation involving interaction and 3D move D a suitable graphics card is needed QD e VRML browser a software which can be downloaded for free A P e Java J2SE kit software can be downloaded for free CA Q Cindy Yung 2 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 1 4 Structure of Report This report has been written for two types of readers first type of readers being experienced technologists who are not familiar in this field and second type of readers ie who are specialists in this field of the project Readers D experienced in this subject may wish to skip the initial chapters to gain rapid tie of the project Readers with brief or no knowledge of this e subject are ad ead all chapters to fully understand the project 1 5 Author s Plane Author has studied T logy at University of Hertfordshire for few years and has a placement year woff e ith highly trained engineers in technical hegxpexience gained this will be a challenging support for hard and software Fro project as the author has basic knowled e of Java to create a multimedia application and no knowledge of VRML until this why meet the requirement
85. mation s M M eoo pe ten Cast a d tegat wane ROS 2 1 Introduction 3 IU n 2 2 Basic 3D Concer KM cM DEI MINE 2 2 1 Fasht Handgle Sa ctl e re ten erant end 2 3 Bnefhistory of VRML Nae eerte t tae entere te innen 2 5 1 MRIS T0 odia cei esn al taaqts earn ccslana aes VON D e NSUR ARRA 2 3 2 VRML Oense tien qw mH 2 3 4 X3D the next generation of VRMIV24 Lseeeeesssssssssse 2 3 5 X3D Baseline K 2 44 History Of Java toca oat cius oe MENU 2 4 1 Basic Of Java o ers ete Mes alle eo feeder 2 4 2 Typical Java Environment Q ca a Sila EET 2 5 What is Java 3D e d 2 5 1 What Java 3D ATIS 5d ninani n o a o te oett 2 5 2 Advantages Wap O E 2 5 3 Disadvantages o ee d se pieds cP udin Ae 2 6 Brief history Of Golb suniiietgusndisotssnausiand 2 6 1 History of Golf Ball EL 2 6 2 Standard weight of Golf Ball ssusss d 2 6 3 Physics oF Golf Ballast ave e ncen inin 2 7 Research of 3D golf simulation websites suussss Q seule 2 14 TOPCO likers ereina aoaiina A AER aped va Oe dde ta und ane 212 SDDEHSsCOSGIm Ses sie OA ES NO oda pe or Ren ME oq ud 2 8 UI Ay ee uso pe irc dooce cea cth stan Rast oett eas eas uae doce a Sy RequirementXnabysts oon aa oul eaten oi mde iau Gis Latein tea i ARA EARS 3 1 Introduction a A a a A 3 2 User Reg irements e ode e ena E ete oq aA Mta metuo
86. me to replay your shot icon replays the simulation p3proswing web p3proswing web site launched in a site launched in a new window new window icon replayed the icon replayed the simulation simulation All VRML browser functions interacted with the simulation as planned The 7 predefined viewpoints displayed golf course automatically All VRML browser functions interacted with the simulation as planned The 7 predefined viewpoints displayed golf course automatically re adjusted to the adjusted to the browser size browser size Golf wrl opened Golf wrl opened 5 3 Testresult Applica d Golf course 02 Table 6 Test result Application and Golf fon Description JA Expected result Actual result x fields on Golf course 02 a 2 Interface Insert values on only Rel Result failed to x D mewiemide EARS imt see if resize web Dlowsers olf course automatica browser size Interface Insert symbols or Result failed to alphabets values in the text fields submit Interface Insert any values positive negative and decimal points in all text fields 5 Interface Insert values 0 on all text fields Test to see if all values inserted would Golf wrl be generated and viewable Test to see if some values inserted would Golf wrl be generated and viewable Test to see if symbols or alphabets is inserted would Golf wrl be generated and viewable
87. n and Electrical Engineering ud University af Hertfordshire BSc BEng Final Year Project Report Appendix E Golf course Multiple point views Therggfe seven predefined view points on both Golf courses 01 and 03 Both golf cours in the same predefined view points On that note a set of seven screen shots will beastod amp ced A Tee low Tee high Guided tour Green front f Green behind Bridge Overview Q Figure 56 Multiple view points 94 Cindy Yung U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report Replay your shot Figure 57 Mr Norman Lindsay sign pole Appen Test Results Sgyeen shots Below are some of t Ce screen shots taken 9 tepectReper DADDY pl Enter ADOV part3 Version 2 0 Created by Cindy Yung 15 rie 4 on b Mosna i ui Dabo oad oq issues Vs Uca e Ca asa TT tma E 1 gt ub ade EI Bern sa qu nha oer Ld corrum eher ode mel See o la Gn Tt L fh e nO ntn on Figure 59 Test if GolfTek billboard open GolfTek web sites in a new window Cindy Yung 95 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report K Ue 60 Test if Lindsay Golf billboard open Pe winasay Golf web sites in a new window Appen
88. nd balls they can now choose from a library of 38 Championship Courses to test their skill Figure 11 LS Golf 3 simulator Gathering from both websites the Youu courses must be fun with some challenging difficulties User friendly in the tegifhical side of build such as the application must be easy to access clear diSpla olf ball trajectory and navigation around the application 2 8 Summary Se Let s recap on Norman Lindsay s idea In his idea MO itnbedded underground over the whole golf course with wireless equipment to pick C each ball which then instantly displays where the ball is landed in predic Qu when golfer takes the shot after 2 3 second a simulation will display on screen where the Cy x On that note the languages most suitable for this project are VRML 2 0 and Q Software Development Kit J2SDK Why Because both languages are free to ball is landed and how distance travelled download and minimum requirement is needed spending less time in research means more time on the actual project Cindy Yung 19 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 3 Requirement Analysis 3 1 Introduction This chapger contains two main sections i e User requirements and Developer requifementse In those sections each will provide relative requirements for different type of Us t the end of this chapter users should a
89. new GridLayout 6 6 5 0 m sideSpin new JTextField 10 ControlPanel add m sideSpin ControlPanel setLayout new GridLayout 7 7 5 0 buttonEnter new JButton Enter buttonEnter addActionListener new ActionListener public void actionPerformed ActionEvent ae dispose double text Double valueOf vali getText trim doubleValue double text2 Double valueOf val2 getText trim doubleValue double text3 Double valueOf val3 getText trim doubleValue double text4 Double valueOf m_backSpin getText trim doubleValue double text5 Double valueOf m_sideSpin getText trim doubleValue new ReadWriteFile text text2 text3 text4 text5 D ControlPanel add buttonEnter BottomPanel new JPanel BottomPanel setLayout new GridLayout 1 1 ControlPanel setLayout new GridLayout 8 8 5 0 Version new JLabel Version 2 0 Created by Cindy Yung ControlPanel add Version container add TopPanel container add ControlPanel container add BottomPanel setSize 450 270 Dimension screen Toolkit getDefaultToolkit getScreenSize int x screen width 450 2 int y screen height 270 2 setLocation x y setVisible true try jbInit catch Exception e e printStackTrace private void jbInit throws Exception public static void main String args GolfInput application new GolfInput application setDefaultCloseOperation
90. nication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report Fix 2 Create another instruction to warn users that entering value 0 the simulation will not be displayed In general the simulation is built to display a golf ball trajectory therefore if end users decided to enter 0 as the value the golf ball will go nowhere as a result 6 qfngusion Doing this pi has taught the author a lot on 3 dimensional environment especially working with owerful languages to create a highly constructed simulation to produce an accurateNgajectory of a golf ball The final M it tfon has proven that it achieved all the aims and objectives stated in chapter a exceeded the specifications set on the project with extra golf courses ad application bringing more attraction in using the simulation Also it proved that the gfpliGation is flexible in which modification can be easily done to put in new golf di There is one problem on the simulation why the golf ball went underground which was caused by mis calculation in the fi rovided At the end of the calculation the values should return to 0 0 0 MN the origin but in this case the calculation produced negative values leading to t as returning below ground C level P Also to improve a better landing of the golf ball the o rH foundation can be transferred into a program languages whic out the 3 dimensional ground and can reset the origin t
91. nited States of Ameriod Spb Peter McBride Java a Made Simple Books Great Britain 1997 99 Andrea L Ames David oS oe John L MoreLand VRML2 0 Source Book Wiley United States of America O Useful Site For X3d http www web3d org http xml coverpages org vrml X3D html http www realism com Web3D x3 autoriais OND http www xj3d org tutorials general_sai html A http www xj3d org javadoc index html A http www xj3d org tutorials examples sai SimpleSAID va http www xj3d org tutorials examples sai FieldAccessDe ec http www xj3d org requirements html https j3d QD core dev java net servlets ProjectDocumentList folderID 2963 amp expandEp lder 2963 amp folderID 0 CA https games binaries dev java net build index html Q http www mozilla org rhino download html http www vrinlsite com vrmljava http www vrmlsite com feb97 a cgi spot2 html http www web3d org x3d specifications ISO IEC 19777 1 X3DLanguageBindings ECMAScript Part1 examples html Cindy Yung 48 U Department of Electronic Communication and Electrical Engineering BSc BEng Final Year Project Report University of Hertfordshire X3D and XML http www xml com pub a 2003 08 06 x3d html page 2 x3dBrowsers X3D Example http mediamachines com samplefiles html http Mwwwsbitmanagement de Ba a isses i dM X3D http www web3 l argix3d overview html Information on Vi hp ipa om loris hm http www vrmlsite com h
92. ntrolPanel new JPanel Border ControlPanelBorder BorderFactory createTitledBorder Golf Value ControlPanel setBorder ControlPanelBorder valLabel new JLabel Please enter Speed m s ControlPanel add valLabel ControlPanel setLayout new GridLayout 2 2 5 0 vali new JTextField 10 ControlPanel add val1 ControlPanel setLayout new GridLayout 3 3 5 0 val2abel new JLabel Pleae enter Vertical angle deg ControlPanel add val2abel ControlPanel setLayout new GridLayout 3 3 5 0 val2 new JTextField 10 ControlPanel add val2 ControlPanel setLayout new GridLayout 4 4 5 0 val3label new JLabel Pleae enter Right left deg ControlPanel add val3label ControlPanel setLayout new GridLayout 4 4 5 0 val3 new JTextField 10 ControlPanel add val3 Cindy Yung BSc BEng Final Year Project Report 71 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report ControlPanel setLayout new GridLayout 5 5 5 0 m_backSpinLabel new JLabel Pleae enter Backspin revs sec ControlPanel add m_backSpinLabel ControlPanel setLayout new GridLayout 5 5 5 0 m backSpin new JTextField 10 ControlPanel add m backSpin ControlPanel setLayout new GridLayout 6 6 5 0 m sideSpinLabel new JLabel Pleae enter Sidespin revs sec ControlPanel add m sideSpinLabel ControlPanel setLayout
93. o incline the camera BSc BEng Final Year Project Report ight hcline to the left Dox the right 9 B o Use STUDY PLAN t eXaming an object from various angles 1 Forward move the wu 1 Backward move the o d p the center of bounding box of the geometry in t scene Q A E E Ose Use STUDY TURN to examine an object from various e 9 is ep Forward Backward Right and Left e around the central point which is defined by the center of bounding box o etry in the 3D IPA e 3D scene Note Move the mouse while holding down the ALT key to switch marO Move the mouse while holding down the Space key to switch STUDY PLAN Move the mouse while holding down the ALT Space keys to switch STUDY ROLL Right Left move the camera arou e central point which is defined by Cindy Yung 108 U Department of Electronic Communication and Electrical Engineering i University of Hertfordshire s 9 Use STUDY ROLL to incline the camera around the central point which is defined BSc BEng Final Year Project Report by the center of bounding box of the geometry in the 3D scene e f Dye to the left Left or right Note The VRML tn choose the rotation center in the EXAMINE navigation mode By default whefhi INE mode Cortona VRML Client sets the center of rotation in the center of thedsGugfling box of the scene geometry But it is possible to change this center by specifys ee additional values in the
94. o install and run 3D Golf Ball Trajectory application sss 96 How to navigate around VRML browser eeseseeeeeenn een 104 Moving around Walk Fly and Study ssssssseenee 104 Rcsore Fit and Her oou socero boe tette eoi a aad dad bu iae acd eit cess 109 Sing Keyboard for Navigating 155 t oct este ha tete tedesca von eda ona 110 PN QUI o AN 113 Questi iA SEA E T AAE AA S EAE 113 Questi P ATAI A Oct E S E N 114 Appendit 4 gta DC E EOS ONE 116 COTY OAT s c 116 Interface Go SOEUR EAT ENDE MEAE EDDA RIEN S SEE RT LCUE 116 Golf course esis Ronde eS qma ee S stus uk auum e hanes 117 Appendix J LD Venet aie ad Leelee hte ES dM ce Ll pee te I LP cd 118 bd Project Time Plan on 1 NCC PURSE PEE 118 a Initial Project Tim antt ULT E 119 Final Project Time Pta ILC HAE enient os heehee eee heey irene a a 120 Appendix K CD ROM Contents Application ace caras ax A Sa vesica Pi Veiis Final Report sssess POStQE sistens esi et ates iiuig SoftWare Ge o ER Oo Rd R eadVIg DUI us actes bares eene Cindy Yung vii U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report List of Figures Figure I XY coOrdinafes a cuscuaisre A i IS IRI TA IIS HAT GATA ARIA NOMINE AREAS ELIT DAR ae 4 Figure 2 XYZ coordinates ics o eset to eae et ene aed c Se Neo iae
95. o of the course let s void collision between the golf ball and the ground 2 Overall the project was very challenging and at times it was almost Ne move on as each component needed to link with each other in order to procee forward Although the project was very challenging it was interesting as well which gave the motivation to resolve the issues and pushed on as quickly as possible to see the final outcome Cindy Yung 45 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report With the help of feedbacks obtained from the questionnaires further improvement can be made as follows d a company logo on the interface as a background to give a professional i also branding the application e yis instruction on the interface on how to use the application and wh a odii can it support e Create olf courses to choose from e The SJ n be transferred online upon request as VRML runs on the A x base demonstration of teaching golfer how to improve their skill web browser uld be either for advertisement of Mr Lindsay s future golf driving M O Oe O KG Cindy Yung 46 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report REFERENCES 1 H M Deitel and P J Deitel Java How To Program 5 Edition Prentice Hall
96. of the aims and objectives of this project it could be cons a restriction to the project but this can be resolved by familiarization with the lan Pe ability 2 G Cindy Yung 3 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 2 Background Information 2 1 introduction In this chapter it will describe each language that could be related to this project golf ball and a summary of which language is best suited for the golf coordinates Figure 1 KE Figure 1 XY coordinates Source xvrml net O know as XYZ To enable understanding of 3D world there is a need erstand why there are three axis coordinates first With the illustration below Figure 2 it should provide a better understandi Qow 3D works The difference of 3D coordinates from 2D is that 3D contains Dae is o Cindy Yung 4 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 3 Cw 9 Figure 2 XYZ coordinates Py Source xvrml net The coordinate of point re In a 3D space is X Y Z the origin of coordinate is 0 0 0 0 0 0 O oA X axis As seen from Figure 2 line freffi left is negative to right is positive along the X axis the coordinate presents X 0 0 do Y axis As seen from Figure 2 line from is negative to up
97. ols or EV M ee alphabets values in the text fields submit Interface Insert any values Result Oo Result submitted positive negative and decimal points in all text fields 5 Interface Insert values 0 on all Result submittg Besult submitted M Test to see if all values inserted Golf wrl would Golf wrl be generated generated and enera and viewable viewable 7 Test to see if some values Golf wrl failed i inserted would Golf wrl be to generate or ew rate generated and viewable viewable Test to see if symbols or Golf wrl failed ef Sf alphabets are inserted would to be generated or to be generated or Golf wrl be generated and viewable viewable viewable Test to see if any positive Golf wrl Golf wrl Z negative and decimal points generated and generated and values inserted would Gol wrl viewable viewable Cindy Yung 43 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report be generated and viewable c x Test to see if values O inserted Golf wrl Golf wrl was would Golf wrl be generated generated and generated but and viewable viewable failed to open Golf wrl click on golfTek golfTek web golfTek web billboard to launch its web sites site launched ina site launched ina in a new window new window new window olf wrl click on linds
98. ort Cindy Yung 67 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report keyValue 000 for int i20 i lt 100 i distance calDistance speed vAngle rightLeftVal height calHeight speed vAngle rightLeft calRightLeft speed vAngle rightLeftVal preValA preValA 0 1 distance preValB preValB height 0 1 preValC preValC rightLeft 0 1 if i 99 sb append preValA preValB preValC n else sb append preValA preValB preValC System out printin Current Pos i distance preValA height preValB Right Left preValC sb append n DEF SCRIPT Script n eventIn SFBool set val n n field SFBool first TRUE n field SFInt32 i 0 n field SFNode timer USE TIME n field SFNode interp USE PI n field SFNode root USE ROOT n n directOutput TRUE n url V javascript n n function set_val clicked n if clicked n if first n Cindy Yung 68 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report first false n Browser addRoute timer fraction_changed interp set fraction n n else n if i gt 0 4 Browser deleteRoute interp value changed root children i 1 set translation n T else Browser delet
99. ouble val5 int val6 golfCourseChoice val6 setContent val val2 val3 val4 va as private void setContent double speed double v le double rightLeftVal double backSpin double sideSpin StringBuffer sb new StringBuffer StringBuffer content new StringBuffer Q String orignalFileContent String newContent double distance 0 00 height 0 00 rightLeft 0 00 Zz double vA 0 00 vB 0 00 vC 0 00 v 0 00 alpha 0 double preDistance 0 00 preHeight 0 00 preRightLeft 0 yy System out println New input 4 4 4 4 4 4 4 4 4 spe System out printIn New input 2 vAngleF System out println New input 3 B een 5 FileWriter new FileWriter Write Golf wrl with the new values in the specific location try BufferedWriter out new BufferedWriter new FileWriter Q c FYP version5 Golf wrl false nitial calculation vA callnitialVa speed vAngle rightLeftVal vB calInitial Vb speed vAngle vC calInitialVc speed vAngle rightLeftVal alpha calAlpha sideSpin backSpin Cindy Yung 83 Department of Electronic Communication and Electrical Engineering A HO University of Hertfordshire BSc BEng Final Year Project Report for int 1 0 i lt 100 i If height lt 0 VA VB VC will to 0 else calculate this if i gt 0 1 if height 0 v calV vA vB vC Z d
100. partment of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report ACKNOWLEDGEMENTS I would like to say a special thank you to Mr David Lee for his supervision support and encguragement I am grateful to him for his guidance constant support and eng uragement which made it possible for me to achieve all my goals and provided a 7 experience A special CA u should be given to my client Mr Norman Lindsay for providing the ideas related Q and support throughout the project I would also like to ch family and friends for supporting me tolerating my long hours of unavailabili 7A project qua O Oe O KG Cindy Yung ii U Department of Electronic Communication and Electrical Engineering University of Hertfordshire Table of Contents DECLARATION STATEMENT 0 ccceeseeccccccccccscssssecccccccccsssssseccccccceesuaaeeseeeececs ABSPRACI mtu tied ig se Seti ake a eta es Sete atest AC WLEDGEMENTS A E Table of KSA a I TAE List o wey AAE MEAE p Neagle the M a E i List of T oS P I a aanctelces List of s tote omne td db eto dd pts 1 1 Project Aims 3 7 Delia oars gaa tes eth sen T 1 2 Project Ovjecytes Qu S 1 3 Restrictions va st Rev dia PER 14 Structure ORRO O oo CO te a a A re atc L5 Au thor s background uus ccce tp Ced ternas cati ap av ud eris 2 Background Into
101. port 2 3 Brief history of VRML VRML ds for Virtual Reality Modelling Language which was born in 1994 as the fifst versi n VRML appeared to the world VRML didn t take off to the world and the hy it was that id e The sl over the net back in the days internet speed run at 28K or less which roof Dre time to load e VRML need on specific browser in order to view 3D objects e Can not mix ifte DI With other programming languages 7 As from above the reason P en didn t take off as much as they hoped for was down to un user friendly process Q 2 3 1 VRML 1 0 K The first version of VRML allows for the reif iua worlds with limited interactive behaviour These worlds can contain ve have hyper links to other worlds HTML documents or other valid MIM object with a hyper link the appropriate MIME viewer dete When the user selects a link to a VRML document from within a correctly tured WWW en the user selects an browser a VRML viewer is launched Thus VRML viewers a erfect companion applications to standard WWW browsers for navigatie rl visualizing the Web Future versions of VRML will allow for richer behaviours ficl ing animations motion physics and real time multi user interaction 1 CA 2 3 2 VRML 2 0 VRML is a language for specific dynamic 3D scenes through which users can navigate with the help of a VRML browser VRML scenes can be distributed over the Cindy Yung 7 j Department of Electronic Commun
102. rated with the input data from end user Cindy Yung 37 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report e The Golf wrl should display the simulation of the golf ball trajectory e The trajectory of the golf ball can be changed at anytime with a different set of input data inputted from the Java interface and submitted the data e To display the result again simply click on the image with the description 9 me to replay you shot in the golf course to see the new result 4 14 Separation of files methods Before Dy application into different files there is a need to find out what are the metho rform the task first Below are the methods used to separate the file for the apptio ey BufferWriter Wri to a character output stream buffering characters so as to 7 3 single characters arrays and strings 11 provide for the efficie System out print seio fue display values or variables on screen but does not do a line feed at the end If two or m ems appear in a continuous line use a 12 succession of prints followed by aV f StringBuffer A string Buffer is like a stri ut can be modified at any point in time it contains some particular sequence of cp ffacters but length and contain of the sequence can be changed through certain meth s 13 FileWriter is used for output of character data to a GR He
103. re is where it is in the hierarchy of Writer classes 14 O poe tes A Writer abstract s pem p Mes gt FilterWriter abstract Ese e ES Figure 34 FileWriter hierarchy 14 Cindy Yung 38 Department of Electronic Communication and Electrical Engineering University of Hertfordshire U 4 14 2 Sample section of Final application This is a sample section source code of the Final application private String getContents checks on Golftest are omitted elided StringBuffer contents new StringBuffer declared here only to make visible to finally clause BufferedReader input null try use buffering this implementation reads one line at a time FileReader always assumes default encoding is OK if golfCourseChoice 0 input new BufferedReader new FileReader C FY P versionS golf1_V13 wrl else if golfCourseChoice 1 input new BufferedReader new FileReader C FY P version5 golf2_ V09 wrl else if golfCourseChoice 2 input new BufferedReader new FileReader C FY P version5 golf3_V04 wrl BSc BEng Final Year Project Report Locate the VRML source file without KeyValues String line null not declared within while loop while line input readLine null contents append line orignalFileContent getContents newContent replace orignalFileContent REPLACECODEHERE sb toString Figure 35
104. reter reads bytecodes and translates them into a language that the computer can understand possibly storing data values as the program executes Cindy Yung 11 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 2 5 What is Java 3D Java 3D4 an application programming interface API developed at Sun Micr systegss for rendering interactive 3D graphics using the Java programming Si runs on top of either Direct3D or OpenGL Comparing to olutions Java 3D is not only a wrapper around these graphics API s but an inea encapsulates the graphics programming using a real object oriented concept A s ne could construct using a scene graph to represent the objects that have to be Md is structured as a tree containing several elements that are necessary to disp bjects Additionally Java 3D offers extensive specialized sound support 5 2 5 1 What Java 3D Aims Q When Java 3D was created the aims are to create high quality effect for 3D worlds with independent platform producing high perfe in 3D graphics and with high level 3D capacity for Java P 2 5 2 Advantages O What are the advantages in Java 3D below are few re Ey e Provide a high level object oriented view of 3D graphics Acc 23 by scene graph based on 3D graphics model e A growing number of 3D loaders are available to import content QA 3D runtime For example Java 3D VRML97 file lo
105. roject Report OA ACC BERR C COMBBRBRRENE E 2 TAN Loan SSE SE WI ae tof CD Cindy Yung 122 U Qo Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report Cindy Yung 123 U Department of Electronic Communication and Electrical Engineering BSc BEne Final Year Project R University of Hertfordshire OENES d REPOR Appendix K CD ROM Contents Appligation e Oo M Final Report Q fm Poster QD e L e posterUni ppt Oy e Poster JPG JF Software O e Cortvrml exe VRML Browser ReadMe htm e Fyp zip e FypUni zip e img Osx O ES P AA Q 125 Cindy Yung
106. shire BSc BEng Final Year Project Report Version 2 ReadWriteFile java Source code import java io import java lang Math import java lang String public class ReadWriteFile public double preValA 0 00 public double preValB 0 00 public double preValC 0 00 public ReadWriteFile public ReadWriteFile double val double val2 double val3 setContent val val2 val3 static public void setContent double speed double vAngle double rightLeftVal StringBuffer sb new StringBuffer double distance 0 00 height 0 00 rightLeft 0 00 double preValA 0 00 preValB 0 00 preValC 0 00 System out printin New input UG speed System out printin New input 2 vAngle System out printIn New input 3 rightLeftVal try FileWriter new FileWriter BufferedWriter out new BufferedWriter new FileWriter c Fyp version2 Golf wrl false sb append VRML V2 0 utf8 n n NavigationInfo headlight TRUE type EXAMINE VANYV n Background skyColor 333 333 333 M Viewpoint 1 n position 10 0 8 0 25 0 n orientation 0 947 10 6 0 068 0 80 n description click n n n DEF ROOT Group n children n n Transform Mn children n DEF BOX Transform n translation 4 0 5 0 n children n Shape n appearance Appearance material Material n geometry Sphere
107. stance specified under USGA conditions 2 6 7 of Golf Ball A Imagine when ing golf and ever wonder how a golfer would know where to hit a ball to predict w ight land With the explanation below it should give a better understanding when a shot in golf Let start of with backspin ackspin imparted on a golf ball this will cause the ball gaining loft and stay in thg auslonger As the ball spins in the air the air above the ball is moving faster than the air peteyy the ball Because of the difference in air pressure the ball itself has m pushing it up which provides it to stay longer in the air With the spin it also asssft golfers to produce more accurate shots With a backspin imparted on a ball the ball drof quicker toward the end of the shot After hitting the ground the backspin aid the fa quicker Here is a example of a ball path with different amounts of backspin P m Spin Rate Blow up XCOS S Appropriate Insufficient Longer carry amp run 100 200 l 300 yards Figure 8 Spin Trajectory Of A Golf Ball Q Source ffden 2 phys uaf edu Dimpled golf balls fly much further than smooth balls The reason why dimpled balls travel further than smooth balls is because the dimples on a golf ball create turbulence in the boundary layer Boundary layer is a thin layer of air surrounding the golf ball as Cindy Yung 16 U Department of Electronic Communication and Electrical
108. t of Electronic Communication and Electrical Engineering University of Hertfordshire vid root children root children length 1 set translation ovt n BSc BEng Final Year Project Report n Browser addRoute interp value changed root children i n itt i root children length n H n n v n n n ROUTE TOUCH isActive TO SCRIPT set val n out close catch IOException e Version 2 applica X p N de Golf Input Jog ene Golf Value Please enter Speed mis 30 Pleae enter Vertical angle deg 20 Pleae enter Rightleft deg o Enter sion 0 1 Created by Cindy Yung Cindy Yung E Cert Gal ot REA trat Lager Jie 0 n n vons 62 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report Version 2 Golflnput java Source code import java awt import java awt event import javax swing import javax swing border lt p gt Final Year Project Code lt p gt Main class to the image processing class give user choice to choose from either automatic or manual processing mode author Jeffrey Yung Qversion 1 0 import java awt import java awt event import javax swing import javax swing border lt p gt Final Year Project Code lt p gt Main class to the image processing class
109. t of tools to write software in Java Z A Java is a powerful oo fn object oriented programming language suitable for writing anything from a dastripii fed application that runs on a corporate network to a database driver Web site Sofa personal photo gallery To make it easier to learn the Java language was designedsie resemble some of the most popular programming languages in use tod notably C C 2 a 2 4 2 Typical Java Environment In creating Java programs normally it goes throu ife ases to be executed using Java development environment Figure 6 These areg dit pile load verify and O A execute e Cindy Yung 10 U Department of Electronic Communication and Electrical Engineering BSc BEng Final Year Project Report University of Hertfordshire Regs a gt Phase 2 contr a Primary 2 Phase 3 Class Loader Primary Memory Phase 4 Primary Memory Phase 5 Interpreter gt CT Figure 6 Typical Java enviro Source Java how to program by H M Deite Deitel 4 Phase 1 Program is created in an editor and stored on disk a ending with java Phase 2 Compiler creates btyecodes and stores them in disk i ending with class Ay Phase 3 Class loader reads class files containing bytecodes from di k an outs those bytecodes in memory CA Phase 4 Bytecode verifier confirms that all bytecodes are valid and do not Java s security restrictions Phase 5 Interp
110. th gfffve Outcome effect displayed a smooth of the golf ball trajectory Nu of the golf ball trajectory Screen shots of the application version 3 are 14 Appendix B D 9 P Cindy Yung 32 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report 4 10 3D golf course VRML As shown above version 3 application was a successful implementation the next stage is to construct the 3D VRML golf course The layout design of the golf course is an imitata n of an existence web golf course 10 This secti ludes Software used Implementation of golf course and Screen shots of final V If course 4 11 Softwar There are three app igatfons used to code the 3D golf course as follows 4 11 1 im VrmlPad is a powerful Me r VRML programming It offers visual support for the scene tree and document reso operations The main key features are a e Smart auto complete e Dynamic errors detection e Syntax highlighting Q e Visual support of the Scene Tree e Operation on the resources Oe e Integrated script debugger O e Automation and scripting e Multiple documents Q e Preview scenes P AC3D is used to create 3D models for virtual reality simulation software Kev 4 11 2 AC3D scientific medical and general data visualizations also rapid prototyping of designs and high resolution 3D renderings
111. the evaporated milky juice or latex pr from a tree most commonly found in Malaysia Gutta balls were handmade byg6llitiggthe softened material on a board The new durability of the Gutta together witlf its lower cost resistance to water and improved run provided rejuvenation to T of golf 7 The Hand Hammered Gutta The hand hammered gutta valet by hammering the softened ball with a sharp edged hammer giving the ball an ses that greatly improved its play Later balls formed in iron moulds or ball pf ss that created patterns or markings on the ball were introduced 7 CA The Bramble Surface textures and patterns impressed into the Eo evolved from early imitations of feathery ball stitching to the highly detailed and symmetrical that greatly improved the ball s flight The best known balls were the hand marked private brands of the Scottish club makers such as Morris Robertson Gourlay and the Auchterlonies Many brands with a variety of patent names used the Cindy Yung 14 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report bramble pattern with a surface similar to the berry This became the most popular pattern of the gutta era and was also used on some of the early rubber balls 7 The Rubber Ball It was invented in 1898 by a Cleveland Ohio golfer Coburn Haskell gff association with Bertram Work of the B F Goodrich Company The b
112. tion Start Finish October 2005 e November 2005 December 2005 January 2006 February 2006 March 2006 April 2006 Lu ERE ERER N EAE CEREDEERN ry FRTSSHTNTSSHINTSNTSSIN NTESMINTSSMENTSINTSSMINTSSITNTISHTNTSSHINTSSHTNTSSHTNTSSHTNTSSMINTSSHNTSSHTNTSBHTNTSSHNESHTNTSSMENT SVENTSSVIVT SINTESINTS Research 2mons Fri 1440 05 Thu 08 12 05 To research various 3D application 1mon Fri141005 Thu 10 11 05 programming language on their compatibility The main objective is to Research in depth on 3D Java language 1mon Fri11 1105 Thu 03 12 05 Design Development 14wks Tue 2211 05 Thu 23 02 06 To create a 3D sphere golf ball with 1wk Tue 22 11 05 Mon 23 11 05 animation to move from left to right Testing 2days Tue 29 11 05 Wed 30 11 05 Stage write up 1day Thu 0112 05 Thu 01 12 05 To create a 3D spinning sphere golf ball 2wks Fri0242 05 Thu 15 12 05 travelling in a straight line in a 3D Testing 2days Fri 16 12 05 Mon 19 12 05 Stage write up 1day Tue 20 2 05 Tue 20 12 05 Creating a 3D environment showing a 2wks Wed 2112 05 Tue 03 01 06 sphere golf ball travelling in a trajectory form Testing 2 days Wed 04 01 06 Thu 05 01 06 Stage write up Aday Fri 06 0106 Fri 06 01 06 To create zoom bird eye view and landing 3wks Sat07 01 06 Thu 26 01 06 area functions for object 24 Testing 2days Fri 27 01 06 Mon 30 01 06 Stage write up 1day Tue 31 01 06 Tue 31 01 06 Display of a golf ball travelling in different tur 2 wks Wed 01 0206 Tue 1402 06 T
113. tion and the Default skin e Arrow Up move closer a e Arrow Down move further away e Arrow Right turn to the right e Arrow Left turn to the left Q e Arrow Up on the numeric keypad move cp e Arrow Down on the numeric keypad move 9 e Arrow Right on the numeric keypad move to tie If the STUDY mode move the camera around the center of rotation Ia e Arrow Left on the numeric keypad move to the left eto mode move the camera around the center of rotation AY e 7on the numeric keypad turn the camera downward wont Sing axis ps e 9on the numeric keypad turn the camera upward around its Ne is e onthe numeric keypad incline to the right Note It is not NN e WALK mode e 3on the numeric keypad incline to the left Note It is not available in WALK mode e Gray Plus move up in the case of FLY mode Cindy Yung 110 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report e Gray Minus move down in the case of FLY mode e lonthe alphanumeric keyboard incline to the right Note It is not available in WALK mode e 2onthe alphanumeric keyboard incline to the left Note It is not available in K mode amp 3 opsfhe alphanumeric keyboard turn downward If the STUDY mode move thg aMera around the center of rotation e 4offt Diss keyboard turn upward If the STUDY mode move the ca ound the center of rotation
114. ttp tecfa unige ch guide rmiman node5 html Proto http h anim org Specifications H Te of SFstring http www parallelgraphics com developer p cts vrmlpad reference proto library proto http accad osu edu pgerstma protolib index ode VisibleTransformsPackage VRML Script Ox http docs rinet ru WebPub ch41 htm How to use xor ee ee Proposal 4VRMLScript Node Authoring Interface refer proto http zing ncsl nist gov gseidman vrml repos refer txt examples LScript http www xvrml net tutorial instruction php p 3dconcept Xvrml Included Right Handed Rule CA Java 3d And Vrml 97 http www javaworld com javaworld jw 01 1999 jw 01 media html Cindy Yung 49 U Department of Electronic Communication and Electrical Engineering BSc BEng Final Year Project Report University of Hertfordshire VRML1 0 http www web3d org x3d specifications vrml VRML 1 0 index html VRML Collision Node Jighthouse3d com vrml tutorial index shtml VR 2 Node http www Object To eeu Detection Interface http www parall srgpihic s com developer products cortona extensions collision VRML History Sr MUR ory html Good VRML History nao Om introduction html Vrml1 Vs Vrml2 http www engr mun ca adfisher vrml sld0 VRML Cortona Client http www parallelgraphics com products cortona VRML Web3d http www web3d org x3d vrml Q Vrml97 Web3d http www web3d org x3d spe
115. ty of Hertfordshire BSc BEng Final Year Project Report Version 1 ReadWriteFile java Source code import java io public class ReadWriteFile 4 public ReadWriteFile 4 3 public ReadWriteFile int val int val2 4 setContent val val2 H static public void setContent int Posi int Pos2 System out printin New input Posi System out printin New input 2 Pos2 try FileWriter new FileWriter BufferedWriter out new BufferedWriter new FileWriter c Fyp Golf wrl false out write VRML V2 0 utf8 n n NavigationInfo 4 headlight TRUE type EXAMINE ANY n Background skyColor 333 333 333 n Viewpoint n position 5 609 7 689 13 201 n orientation 647 76 0 068 512 An description click n n n DEF ROOT Group n children n n Transform Mn children n DEF BOX Transform n translation 4 0 5 0 n children n Shape n appearance Appearance material Material n geometry Sphere radius 0 5 n n n n n b n Transform n children n Transform rotation 0 1 0 628 children USE BOX b n n n Transform n children n Transform n rotation 0 1 0 1 256 n children USE BOX n n n b n n Transform n children n Transform rotation O 1 0 1 885 children USE BOX Cindy Yung 60
116. uble text5 Dioubl yafteOf m_sideSpin getText trim doubleValue System out printIn se Choice is golf CourseChoice new ReadWriteFile tex Z text3 text4 text5 golfCourseChoice ControlPanel add buttonEnter ControlPanel setLayout new Gri 5 0 Version new JLabel Version 2 0 yo T Cindy Yung ControlPanel add Version container add ControlPanel setSize 450 270 Dimension screen Toolkit getDefaultToo creenSize int x screen width 450 2 int y screen height 270 2 setLocation x y setVisible true Oe dun O fo y catch Exception e e printStackTrace j j private void jbInit throws Exception 1 public static void main String args CA 1 GolfInput application new GolfInput Q application setDefaultCloseOperation JFrame EXIT ON CLOSE j j Cindy Yung 82 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire ReadWriteFile java The main program import java io import java lang Math BSc BEng Final Year Project Report import jaya lang String imporig va text NumberFormat impoft javad amp t DecimalFormat public cl dWriteFile private auff 5s 0 00 private doub IB 0 00 private double pr 0 00 private int golfCQur oice 0 public ReadWriteFile JM Iink to GolfInput java public ReadWriteFile doubl valgdouble val2 double val3 double val4 d
117. ure 41 X3D example source code sese ee Figure 42 Initial application Version 1 Figure 423 Application Version 2 oes ooo s Eo teen esq ei iios Figure 44 Final application iuo o eroi e estt oe derestetsdses iecit Figure 45 Structure of GolfInput class Figure 46 Structure of GolfInput class Figure 47 Golf course 01 Tee low view ceret esae enm ete eene an ihn sonet rina ien PH 9 Figure 48 Golf course 01 Tee high view o SR IUe QUERI DIR QS 9 Figure 49 Golf course 01 Bird eye vieWw sseessesssseesssersserssseesseressresseresseessreesseees 9 Figure 50 Golf course 02 Tee low view sess nietos side Nine ns Re sod MR Qa cena deua PRA 92 Figure 51 Golf course 02 Tee high view 1o tont e OR o dM sr 92 Cindy Yung Vili U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report Figure 52 Golf course 02 Bird eye VIGW oe Eon Eea eee re Givers eeeccehgeataniere 92 Figure 53 Golf course 03 Tee low view osea xit enitn e een nena n ko an une ea ARR ORB ENS 93 Figure 54 Golf course 03 Tee high view cescceeescecessecesseeeeeneeeesseeeesneeessnaeeessaees 93 Figure 55 Golf course 03 Bird eye VIGW desse eea eia ea eor etequd edv bin 93 Figure 56 Multiple view Polos cet rao cette ea t cle on ete atta tb ati 94 Figure 57 Mr Norman Lindsay sign pole ssssssssee
118. ut http www java2s bgsfampleCode File Input Output Readafieandpyge Yne urteredReaderandSystemout him Reading Numbers es File Line by Line http www java2s com ExampleCode File Input Ova unterstonae fle yin 3d World a http www openworlds com x3d html A http www javaworld com javaworld jw 01 O 1 media html Right Handed Rule http www schorsch com kbase glossary right hand o http www schorsch com kbase glossary right hand rul 2 i Cindy Yung 54 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report APPENDICES Appendix A safoyi 3D languages Three languages including Java 3D VRML and X3D were tested to sci fanguage is best suited for this project Java 3D This example is from D programming By Daniel Selman 8 p uod 8 Dy e Background m case the scene is placed within a Sphere e Textured geometry an image is applied to the inside of the background Sphere to give the illusion of a dist e Lighting a single directional rendering e Geometry a second smaller Sphere is p within the scene e Appearance the smaller Sphere has an uS and Material associated with it that interacts with directional light Ma a shaded coloured effect e Animation a PositionInterpolator behaviour i a ed to the smaller Sphere to move it left and right using a complex time fifi Alpha b wm w 3 F
119. utput data Distance Pr i RT Vb xB ve SID 57296 Height PreVb RTT Right or Left PreVc Ve T a e Vc xBsin So n96 Boos 57296 Q 47 Implementation of the design version 2 By using the same principle as version1 version 2 should enclose Cindy Yung 28 Department of Electronic Communication and Electrical Engineering U University of Hertfordshire BSc BEng Final Year Project Report e A Java interface with three text fields including Speed m s Vertical angle deg and Right left deg e Java application together with the trajectory calculations e New wrl file to be generated wrl is extension of VRML e ML file golf wrl to display the outcome effect Th foutcome effect should be a smooth curve pattern of the golf ball trajectory 4 7 1 S section of application version 2 This sample da all the mathematical formulas in Java System out printIn New input System out printIn New input t vAngle public static double calDistance double x double y double z System out printIn New input 3 ft rightLeftVal 1 double dist 0 00 Distance State and collect previous Distance Height and Right left values dist x Math cos y 57 296 Math cos z 57 296 for int i 0 i lt 100 i return dist j distance calDistance speed vAngle rightLeftVal height calHeight speed vAngle public static double calHeight double x double y r
120. vent import javax swing import javax swing border lt p gt Final Year Project Code lt p gt Main class to the image processing class give user choice to choose from either automatic or manual processing mode author Cindy Yung Qversion 1 0 y public class GolfInput extends JFrame HMM HM M INSTANCE VARIABLES LLL private JButton plainButton FancyButton buttonEnter buttonManual private JPanel ControlPanel private JPanel TopPanel private JPanel BottomPanel private JLabel valLabel val2abel Version private JTextField val1 val2 private GridLayout grid1 This constructor will perform the creatiion of the GUI and linking to the other processing GUI public GolfInput super Golf Input setting the GUI with windows feel WindowuUtilities setNativeLookAndFeel gridi new GridLayout 2 1 5 0 Container container getContentPane container setLayout grid1 Department of Electronic Communication and Electrical Engineering k U BSc BEng Final Year Project Report University of Hertfordshire ControlPanel new JPanel Border ControlPanelBorder BorderFactory createTitledBorder Golf Value ControlPanel setBorder ControlPanelBorder valLabel new JLabel Please enter value 1 ControlPanel add valLabel ControlPanel setLayout new GridLayout 2 2 5 0 vali new JTextField 10 ControlPanel add val1 ControlPanel setL
121. versionS gt javac GolfInput java C Fyp versionS gt java Golf Input Figure 208 GolfInput in Command Prompt A java window Golf Wr appear on your screen Figure 13 Type in any values and select Enter amp Golf Input Joe Golf Value Please enter Speed m s Please enter Vertical angle deg Please enter Right left deg Please enter Backspin revs sec Please enter Sidespin revs sec Please select a Golf Course Golf course 01 Enter h Version 2 0 Created by Cindy Yung Figure 13 3D Golf Ball Trajectory application A 9 Once Command Prompt stop running go back to C Fyp version5 inside u see a file called Golf wrl double click on the file This will open in Internet Explorer To change Golf Courses simply click the drop down list select a golf course on the 103 Cindy Yung U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report java application GolfInput and click enter Lastly click on the Refresh button on the Internet Explorer This will display the newest result You have now Successful installed and running the 3D Golf Ball Trajectory igate around VRML browser Information yt party Using Viewpougts A viewpoint describes a position and orientation for viewing the scene The M s Ma probably want to guide the user to the best vantage
122. y Network Save as type WinZip File Figure 2 Saving file on Desktop o Once download is completed please select Close button Figure 3 Cindy Yung 97 ud Department of Electronic Communication and Electrical Engineering BSc BEne Final Year Project Report c BEng Final Year Project Repo University of Hertfordshire Download Complete Fyp zip from mmtprojects4 mmt herts ac uk Downloaded 3 01 MB in 52 sec Download to C Documents and Settings Fyp zip Transfer rate 59 3 KB Sec C Close this dialog box when download completes Qe 3 Download Completed Now locate the r S our Desktop and right click select WinZip Extract to here Ei Print Explore Scan with Norton AntiVirus extract files Extract Here J ym to folder Bedocuments and Settings Nutty Desktop Fyp t Extract to folder gt Open With TextPad t Create Self Extractor Exe Configure Send To k hare Figure 4 Extracting Fyp zip file on to desktop Cindy Yung 98 U Department of Electronic Communication and Electrical Engineering University of Hertfordshire BSc BEng Final Year Project Report A folder called Fyp will be placed on the Desktop Next is to install VRML browser Double click on Fyp folder inside you will see two items version5 folder and cortvrml exe Figure 5 Double gtk on cortvrml exe to start the installation and follow on screen
Download Pdf Manuals
Related Search
Related Contents
Original Instructions - Evolution Power Tools 取扱説明書 - 日立の家電品 UM-IDL2000T(V101206) Sharp PN-V601A Specification Sheet Copyright © All rights reserved.
Failed to retrieve file