express. Table 6.1 Physical dimensions expressed as a
express. Table 6.1 Physical dimensions expressed as a power of 2 2n Meters Units 87.29 Universe (20 billion light-years) 69.68 Galaxy (100,000 light-years) 53.07 Light-year 43.43 Solar system diameter 23.60 Earth diameter 10.65 Mile 9.97 Kilometer 0.00 Meter 19.93 Micron 33.22 Angstrom 115.57 Planck length For example, to specify a distance in light-years (9,460 billion kilometers), find from table 6.1 that 253.07 is equal to 9,460 billion kilometers. That is, a 1 at the 53rd bit position will be approximately one light-year. When mapped into the integer array, the 53rd bit is located within the integer at index 3 53/32 = 2. It is the 21st bit (53 32) within the third integer of the array. The number 221 equals 0×200000, so setting the integer at index 2 of the integer array to 0×200000 will create a HiResCoordinstance that stores approximately a light-year. The integer at index 3 is defined to store meters, so simply setting the integer at index 3 will define a HiResCoordin meters. Conversely, the 20th bit to the right of the decimal point position is approximately a micron. A useful exercise would be to develop a Java class that returned a HiResCoordfor quantities expressed in the various units shown in table 6.1. //creates a Locale that is positioned (232 + 5) meters //away from the origin in the +Z direction. int[] xPos = { 0, 0, 0, 0, 0, 0, 0, 0 }; int[] yPos = { 0, 0, 0, 0, 0, 0, 0, 0 }; int[] zPos = { 0, 0, 1, 5, 0, 0, 0, 0 }; HiResCoord hiResCoord = new HiResCoord( xPos, yPos, zPos ); Once a Localehas been created and positioned, it can be populated with geometry by attaching a BranchGroupcontaining scenegraph elements: //create the Universe m_Universe = new VirtualUniverse(); //create the position for the Locale int[] xPos = { 0, 0, 0, 0, 0, 0, 0, 0 }; int[] yPos = { 0, 0, 0, 0, 0, 0, 0, 0 }; int[] zPos = { 0, 0, 1, 5, 0, 0, 0, 0 }; HiResCoord hiResCoord = new HiResCoord( xPos, yPos, zPos ); //create the Locale and attach to the VirtualUniverse Locale locale = new Locale( u, hiResCoord ); //create the BranchGroup containing the Geometry for the scene 85
If you are looking for affordable and reliable webhost to host and run your business application visit our ftp web hosting services.