A flag icon shows that page is written in: English, Japanese

OpenGL and OpenGL ES (Embedded System)

OpenGL - The Queen of 3D Graphics

OpenGL has been long the standard of computer graphics. Today, it has evolved to support programmable shaders with a language called GL Shading Language (GLSL).

OpenGL 2.x was the last version in which you could freely mix the fixed function pipeline with the programmable pipeline. With the release of OpenGL 3.0 the whole fixed function pipeline has been deprecated officially.

File Format

VRML/X3D is widely used in 3D graphics and polygon modeling. There used to be VRML 1.0 in the beginning of internet age but today VRML97 (2.0) is mostly popular in the world.

X3D is just another style of writing and usually more tedious to handle.

Fundamentally, 3D data to be saved are

and so on.

Especially if you want to include animation, it will also need

Building Xj3D

Download xj3d source code and change to its top-level directory.

$ svn checkout http://svn.xj3d.org/xj3d_code/trunk

Read through HowToInstall.html that comes with the package.

You need to unarchive and install javacc, JMF, JOGL and JOAL first.

Download JOGL precompiled binary in zip format.

It will require copying and specifying class paths as shown for Mac in the following way (JOGL on MacOSX) :

$ sudo cp * /System/Library/Java/Extensions/
$ export CLASSPATH=/System/Library/Frameworks/JavaVM.framework/Classes/classes.jar
$ export CLASSPATH=$CLASSPATH:~/jars/jogl.jar

Sun does not support Mac for JMF, but you can make it work. To download JMF (Java Media Framework) for MacOSX, go to the the web and choose Linux and then Cross-Platform Java (not Linux Performance Pack).

Unpack it and copy jmf.jar to your Library/Java/Extensions.

$ make parsers
$ make config
$ make properties
$ make images

This will build all of the parser source code using javacc

Copy all the .jar files created in the folder named jars to your Java extension directory. In MacOSX, it should be /System/Library/Java/Extensions/.

$ sudo cp jars/* /System/Library/Java/Extensions/

FreeWRL

Building FreeWRL from the source may require these packages too.

$ sudo aptitude install libimlib2-dev libglew-dev
$ configure
$ make
$ sudo make install
$ sudo ldconfig

should work fine.

If you wanna try unstable Debian package, add this line to /etc/apt/sources.list :

deb http://kheb.homelinux.org/debian myosotis-lenny main non-free
#deb-src http://kheb.homelinux.org/debian myosotis-lenny main non-free

Then start downloading the following way :

$ sudo aptitude update
$ sudo aptitude install freewrl

OpenVRML

You will need to have the latest version (1.9.2 at the time of writing) of gecko SDK (a.k.a. xulrunner SDK) which can also be downloaded from : http://www.mozilla.org/projects/plugins/

And also JNI (Java Native Interface). If the system cannot find jni.h then you can make it work.

The compilation of openvrml requires some shared libraries one of which is the OpenGL extension to GTK+. You also need to install its header files. You may need to have libcurl3-dev and libgnomeui-dev installed as well.

$ sudo aptitude install libgtkglext1 libgtkglext1-dev
$ sudo aptitude install libgnomeui-dev
$ sudo aptitude install libcurl3-dev

The compilation says it requires a simple DirectMedia layer development files (libsdl) and newer Boost so I added them to Debian :

$ sudo aptitude install libsdl1.2-dev
$ sudo aptitude install libboost1.40-all-dev

You could try building for Mozilla plugin by giving the directories where gecko-sdk files reside to the configure script :

$ ./configure --disable-script-node-java
MOZILLA_PLUGIN_CFLAGS="-I/usr/local/include/xulrunner/"
MOZILLA_PLUGIN_LIBS="-L/usr/local/lib/xulrunner/"
CPPFLAGS="-I/usr/local/include/xulrunner/"
LDFLAGS="-L/usr/local/lib/xulrunner/"

If you cannot, the following should be good.

$ ./configure --disable-script-node-java --disable-mozilla-plugin
$ make
$ sudo make install

PC Emulation Linux

If you really need to rebuild the components, read the following.

  1. To build a component, first set the SDK directory and the platform to LinuxPC using

    $ export PLATFORM=LinuxPC
    $ export SDKDIR=~/comp/java/ogles11/SDKPackage
    
  2. Go into the component Build/OGLES/LinuxGeneric folder and type

    $ ln -s make_common.mak Makefile
    $ make
    

    You can also build a CommonLite version by typing make CommonLite=1 or a Debug version by typing make Debug=1. The resulting executable will go into a subfolder of Build/OGLES/LinuxPC.

In some of distributions of Linux you encounter a problem when running applications using PCEmulation then you may need to install glew libraries. On Ubuntu it may be done with commands :

$ sudo apt-get install libglut3-dev -y
$ sudo apt-get install libglew-dev -y
$ sudo apt-get install glew-utils -y

Note: Demos and benchmarks can be launched directly from the Binary folder.


Have fun.

Ryu ryu@run.sh