Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesMultiple Java Dimensions


November 1997 / Javatalk / An Uncertain Discovery / Multiple Java Dimensions

In August, JavaSoft announced the new media and communications Java APIs, of which ther e are a passel. They include the following:

I could spend much of the rest of this magazine's pages trying to cover all the APIs, but obviously I don't have enough space for that. Instead, I'll continue my coverage from previous columns, in which I discussed 2-D graphics and VRML, and concentrate on the Java 2D and Java 3D APIs. (You can find and download further information about the other APIs from http://www.javasoft.com .)

Java 2D is actually an extension to the Java Abstract Window Toolkit (AWT). Plans are that it will be included as part of the JDK. The additional classes of Java 2D provide such features as arbitrary fills, tiling, Bézier paths, extended font characteristics (which let you define such font features as kerning, glyph substitution, and ligatures), and a variety of transform operations.

More elaborate elements of Java 2D provide for image-processing operations. For example, Java 2D defines the classes and interfaces necessary for constructing convolution kernels, as well as source and destination image buffers. With the added help of the ConvolveOp class, you can easily implement 2-D filter operations, such as blurring, sharpening, edge detection, and so on.

In addition, Java 2D provides greater control over colors. For example, its color-conversion classes provide for converting among RGB, CMYK, gray scale, HLS, HSB, and a half dozen more color spaces (some of whose acronyms I'm not familiar with).

Java 3D (unlike Java 2D) is a "premium" extension to the standard JDK. What that means in terms of availability and distributability is currently unclear. At the time this article was written, JavaSoft representatives were unable to discuss the details of the business model.

Java 3D runs atop standard 3-D rendering engines, such as OpenGL, Direct3D, and QuickDraw 3D. But since it simply depends on the rendering capabilities of such graphics engines, it can run atop "raw" graphics hardware.

Java 3D is a "scene graphics" API. The virtual universe modeled by Java 3D is stored in a complex tree-like structure that's known as a "scene graph" and is composed of connected objects. Some objects in the scene graph define shapes that are ultimately rendered into the things seen in the virtual world. Other objects define textures, colors, reflectivity, and so forth.

One particular object, called the view object, carries the information needed to render the scene. The view object is itself a composite of other objects. For instance, one of its components is the PhysicalBody object, which contains information describing the characteristics of the viewer (i.e., the end user). The information is frighteningly detailed, and it's obviously designed to model the characteristics of a human viewer immersed in a 3-D world. Data in the PhysicalBody object defines the locat ion of the viewer's eyes -- even the interpupillary distance. The idea, of course, is to provide the developer with a framework that has enough richness to capture the widest range of viewing devices.

A unique component of Java 3D is the 3-D sound component. Given that a scene graph includes a view object, the system has all it needs to deduce the location of the viewer and the viewer's relation (in 3-D space) to other objects in the scene. (In addition, the system has information about the geometry of the viewer himself/herself.) This information is used by the sound engine to provide realistic, spatialized 3-D sound with little programmer intervention. If the viewer is close to an object that's emitting a sound, the sound is louder; farther away, the sound is softer.

Finally, even if you're uninterested in 3-D graphics, you should be aware that Java 3D defines a vector-and-matrix math library suitable for general-purpose mathematics programming. These libraries are not part of the Java 3D API pe r se, although Java 3D depends on them as storage and manipulation classes for data such as coordinates, color information, vector normals, and so on. JavaSoft expects that the members of this library will be removed into a separate java.vecmath package in the future.


Up to the Javatalk section contentsGo to previous article: Multiple Java DimensionsSearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM  
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network