• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Coordinate System

Java 3D, like VRML and all other forms of 3D, revolves around the concept of a 3D coordinate system. As with VRML, the Java 3D coordinate system is a right-handed one where X represents the horizontal (left to right) axis, Y the vertical axis (up and down), and Z the depth axis (front to back) when viewed straight on. Also like VRML, Java 3D units of measurement are measured in meters, where 1 unit equals 1 meter (see Chapter 7, "Customizing Location, Size, and Orientation," for a more detailed discussion of 3D coordinates and units of measurement).

Behind the Scenes with High-Resolution Coordinates

The HiResCoord class (javax.media.j3d.HiResCoord) implements Java 3D's high-resolution coordinates, which consist of 768 bits of floating-point values in 3-space (X, Y, Z). High-resolution coordinates are made up of three 256-bit fixed-point numbers, one each for the X, Y, and Z axis (together totaling 768 bits). The fixed point of each 256-bit number is located at bit 128, where a value of 1.0 represents 1 meter precisely.

HiResCoord contains methods to add, subtract, negate, and scale high-resolution coordinates. HiResCoord methods are also provided to calculate the difference between two high-resolution coordinates, calculate the distance between specified coordinates, and test for equality between coordinates. Java 3D's high-resolution coordinates operate behind the scenes, allowing developers to express 3D coordinates in a more traditional format (high-resolution coordinates are used by Java 3D to transparently layer traditional floating-point coordinate systems on top of a higher-resolution format). X, Y, Z coordinates specified in a virtual universe, for example, are typically expressed as three floating-point numbers.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint