3D Gnoming this week




Probably all of you have already heard the 2 most awaited software
announcements of this week:

1. XFree 4.0
2. OpenAL
3. Other items of interest
4. About 3D gnoming
5. About Floyd

1. XFree 4.0 & OpenGL

http://www.xfree86.org/

Although XF4 proabably came too late to be included in Redhat 6.2 and
Debian 2.2, I still hope it will conquer most desktops before the end of
the year. This will have 2 important consequences:
- OpenGL will be included in every GNU/Linux & xBSD system
- Due to new modular architecture we will see more hardware
  accelerated 3D drivers
As 3D hardware prices keep continuously dropping, I hope that in nearest
future high quality 3D graphics are no more luxury for most users.

What does this mean to users/developers?
Of course, there will not be 3D window managers in near future, as we
cannot easily sidestep X architecture. But many things happening INSIDE
windows (do not forget - most widget are also windows) can be done a bit
different way.
a) Using 3D graphics is often as simple or even simpler than using 2D
graphics, especially for games, toys and visualization tools, where the
'eye candy' appearance is required.
Potential examples: Mahjongg, Same Gnome, Extace, various resource
monitors
b) AS OpenGL is the only de facto hardware accelerated graphics library,
it would be useful to use it even for pure 2D graphics, especially if
application uses many simple polygons, or medium-sized bitmaps
Examples: gnome-canvas

2. OpenAL

http://www.openal.org/

OpenAL is similar in spirit to OpenGL, but dealing with audio sources
instead of visual objects. For real 3D capable soundcards it allows to
simulate the position of sound source in 3D space, for simpler soundcards
to simulate the position of sound source on left-right stereo axis.
Additionally it allows to specify the properties of space, such as echo,
which will affect all sound sources.
The obvious applications for this are, of course, games, but it can do
nice things for other desktop programs too.

- Imagine a display window giving a sound alert. With OpenAL you can give
user the hint of approximate position of the window on screen. It will be
a great help, if screen is full of windows, or if signalling window is
located on another desktop.

3. Other items of interest.

The Quesa library (http://www.quesa.org) was mentioned in Slashdot. It
seems to be quite complete Apple QuickDraw 3D clone, released under LGPL.
I do not know anything about QD3D, so I cannot say much about it. But
those, who have commented, say it is solid cross-platform API. The good
point is that API is C.

I found very nice piece of work, called The GNU Triangulated Surface
Library (http://gts.sourceforge.net/). It implements most useful
functions for dealing with 3D mesh surfaces, including union,
intersection, difference, smoothening and coarsening. It is written in C
and based on glib, so Gtk+ programmers should find it very easy to use.

4. 3D Gnoming

My call for ideas about GNOME 3D libraries some time ago didn't bring many
answers. Still I find, that 3D display engine is extremely useful addition
to GNOME, especially if merged with existing 2D Canvas and openAL audio
library. If we like to make GNOME a dream development environment (what is
prerequisite for making it dream desktop environment), we should include
more API-s, that developers can count on. At moment the big obstacle for
using many GNU/Linux programs is the need to install n+1 different,
potentially conflicting libraries.
Aside 3D display engine we need at least high-level audio library, which
could load and play most audio formats from wav to midi to mp3 (Gnome
Media Framework?)

To illustrate one potential application of 3D gnoming, I created a very
simple game 'Know Your GNOME Icons'. It is basically a clone of well known
'Memory Blocks' game, using GNOME icons and Floyd 3D display. Anybody
interested will find it in Floyd tarball 
(http://www.ariman.ee/linux/floyd/).
Although similar things  can be done with bare OpenGL, or CrystalSpace, or
plib, or simple 2D drawing area, I find that current floyd API, as much as
it has been implemented, is by far most easy and straightforward. And
easier API means more developers. And more developers means more programs.
Mmm...

5. About Floyd

I reworked time model, allowing floyd to slow down world clock, if
requested (if object HAS TO do something at specific time, but previous
rendering was too slow).
Also, view can now compute vision rays and objects can be fired with
these to generate "hit" events. This was badly needed to project mouse
events into 3D space. If I find time (but probably not before GUDEC is
over), I'll try to write quick and dirty GnomeCanvas clone, which can be
projected into 3D space, but otherwise behaves exactly as original (mouse
events, grabbing & so on.) If anybody is interested, help is welcome!
Of course, original canvas has still some advantages:
- widgets (we cannot rotate these in 3D unfortunately)
- line attributes
- text
- 2D Canvas knows the exact pixel resolutions and can adjust display 
to that. When projected into 3D, the resolution will be different even in
different parts of one object.

As usual, I'm interested to hear you opinions:
- does GNOME need more semi-standard API-s (3D and audio formats)
- if yes, do you know any good candidate
- if yes (1) and no (2), do you have any ideas about API
- any comments about floyd

Lauris Kaplinski





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]