Java 2D and 3D Open Standards
This week, amidst a flurry of minor updates
and new APIs released by Javasoft,
we're going to turn our attention to the Java Web site, where several choice
new bits of Open Standard have just been revealed to the surfing public.
Java
2D
You may recall our
brief mention some months ago about the forthcoming Java
2D standard that Sun began
hinting about in late March. The news of late is that
the API is released, and we can now examine it for ourselves.
Sharing the prevailing speculation, we reported that 2D was probably
a rewrite of the basic organization by which Java renders, that is, it actually
draws points, lines, curves, and text on the screen, with the refinements
of color control and anti-aliasing. This was basically correct,
although instead of replacing internal components, we see that Java
elected to duplicate existing functionality.
Until now, Java applications making use of the AWT
have communicated visually with the user through a class called
Graphics.
A Graphics object is made available to Java applets, for instance, when
they're loaded into a Web browser's JVM, for instance; this object represents
the area within the browser's window that the applet may influence. In
fact, every AWT
component carries a Graphics object within it, as long as it has a
peer object representing it in the real world of the user's windowing
system.
Graphics
gives us features like drawString,
setColor,
and fillPolygon.
It also allows us to draw entire images onto the screen. It's the basis
for what we're allowed to do when our applications are producing real-time
graphics. Java2D
gives us another Graphics class called Graphics2D--thus creating effective
backwards compatibility, since our applications, if they use the current
low-level graphics scheme, can continue to use
it as if nothing has changed.
However, your applets, if blessed with a compatible JVM implementation,
may take advantage of a revamped and much improved low-level rendering
system. We found the new organizational structure, although sporting a few
minor stylistic oddities we weren't used to from Javasoft,
to be surprisingly tight and well organized, especially where it shows
its face to the programmer. Adobe Systems is listed as a co-contributor
to the project. A few highlights include:
-
Transparency support
-
Bezier Paths
-
Anti-aliasing
-
Much improved font handling
-
A small but interesting catalog of transformations for images
-
Improved support of specific graphical devices, for example, screens and
printers
It's pretty powerful. We especially liked the graceful way that fonts and
user-created graphical objects are unified as sets of points making
up an outline. We'll certainly have more to say on 2D later on.
Java
3D
We probably weren't the first, but we correctly anticipated 3D graphics
support in Java, and it's here. This product's credits list consists
of almost every major industry heavy-hitter: Intel,
Apple, and SGI
accompanied Sun in this venture.
We found the maturity and complexity of this package quite fascinating.
The package itself is termed java.media.j3d,
and was simultaneously released with a vector math package (java.vecmath).
It seems to contain all the elements for a ready-to-go 3D rendering
system. From our layman's appreciation of 3D software technology, we found
it to be surprisingly full featured and mature (considering its design
constraints).
We'll have time to discuss exactly what went into it in future
issues, but on the surface it appears to be a reasonable balance between
compromise and creative synthesis of what the authors brought to the
table--and that's not to be taken lightly since it's the platforms themselves
that are implementing the actual 3D rendering.
You heard right--Java3D will exist in large part as a cross-platform
arbiter between the various platform-specific, lower-level "immediate mode"
3D APIs: OpenGL, Direct3D, and QuickDraw3D. We imagine these, in turn,
can provide all the platform-specific software support, as well as hardware
support (if it exists) that can turn Java3D
into a useful reality.
Both APIs
are officially submitted for public comment until around the end of the
month, so we encourage you to read up and share your comments.