JSR-184 (Mobile 3D Graphics) on MicroEmulator

69 views
Skip to first unread message

Francois Weykmans

unread,
Apr 24, 2008, 8:21:08 PM4/24/08
to microemulator-developers
Hi,

I would like to be able to show a mapping application (J2ME) using
JSR-184 on MicroEmulator (JWS/Applet)

But after looking for a open-source implementation of JSR-184 on top
of J2SE, I found some converters for the M3D file format but nothing
else...

The JSR-184 specification is clear and well documented and it seems to
be feasible to build a "basic" implementation on top of JSR-231 (Java
Bindings for OpenGL) by using JOGL.

JOGL : https://jogl.dev.java.net/
JOGL - Javadoc : http://download.java.net/media/jogl/builds/nightly/javadoc_public/

some issues :
- need a lot of free time...
- convert the result (buffer) to an Image each time (to use on
javax.microedition.lcdui.Graphics)
- performance (I will break the direct rendering on the video
memory...)

Have you some opinions/advices about this ?

And also thank you for MicroEmulator !!!

Francois










Bartek Teodorczyk

unread,
Apr 25, 2008, 4:07:00 AM4/25/08
to microemulato...@googlegroups.com
On Fri, Apr 25, 2008 at 2:21 AM, Francois Weykmans <fan...@gmail.com> wrote:
>
> Hi,
>
> I would like to be able to show a mapping application (J2ME) using
> JSR-184 on MicroEmulator (JWS/Applet)
>
> But after looking for a open-source implementation of JSR-184 on top
> of J2SE, I found some converters for the M3D file format but nothing
> else...
>
> The JSR-184 specification is clear and well documented and it seems to
> be feasible to build a "basic" implementation on top of JSR-231 (Java
> Bindings for OpenGL) by using JOGL.
>
> JOGL : https://jogl.dev.java.net/
> JOGL - Javadoc : http://download.java.net/media/jogl/builds/nightly/javadoc_public/
>

It would be great to have such a implementation in Microemulator.
JSR-184 is a required element of JSR-248 (MSA) and our long term goal
is to be JSR-248 compliant.

> some issues :
> - need a lot of free time...

This is quite important. But I'm warmly encourage to fill the gaps of
Microemulator.

> - convert the result (buffer) to an Image each time (to use on
> javax.microedition.lcdui.Graphics)

Why? Isn't possible to blit buffer directly on video device?

> - performance (I will break the direct rendering on the video
> memory...)
>

Could you put more information here?

Regards,
Bartek

François Weykmans

unread,
Apr 25, 2008, 1:49:55 PM4/25/08
to microemulato...@googlegroups.com
On 25/04/2008, Bartek Teodorczyk <bar...@barteo.net> wrote:
>
> On Fri, Apr 25, 2008 at 2:21 AM, Francois Weykmans <fan...@gmail.com> wrote:
> >
> > Hi,
> >
> > I would like to be able to show a mapping application (J2ME) using
> > JSR-184 on MicroEmulator (JWS/Applet)
> >
> > But after looking for a open-source implementation of JSR-184 on top
> > of J2SE, I found some converters for the M3D file format but nothing
> > else...
> >
> > The JSR-184 specification is clear and well documented and it seems to
> > be feasible to build a "basic" implementation on top of JSR-231 (Java
> > Bindings for OpenGL) by using JOGL.
> >
> > JOGL : https://jogl.dev.java.net/
> > JOGL - Javadoc : http://download.java.net/media/jogl/builds/nightly/javadoc_public/
> >
>
>
> It would be great to have such a implementation in Microemulator.
> JSR-184 is a required element of JSR-248 (MSA) and our long term goal
> is to be JSR-248 compliant.
>
Wow, You are ambitious ;) and JSR 226 (SVG) will be a big challenge!
(maybe by using a lightweight version of Batik SVG Toolkit ?)

>
> > some issues :
> > - need a lot of free time...
>
>
> This is quite important. But I'm warmly encourage to fill the gaps of
> Microemulator.
>
>
> > - convert the result (buffer) to an Image each time (to use on
> > javax.microedition.lcdui.Graphics)
>
>
> Why? Isn't possible to blit buffer directly on video device?
>
>
> > - performance (I will break the direct rendering on the video
> > memory...)
> >
>
>
> Could you put more information here?
>
We need to control when the drawing is flushing on the screen and be
able to use the alpha channel (image/logo on top of the 3D result for
example) to mix 3D and 2D

An example:

Each time you move/zoom, you need to render the scene

// render the 3d scene
myGraphics3D.bindTarget(g,true,Graphics3D.ANTIALIAS|Graphics3D.TRUE_COLOR);
myGraphics3D.setViewport(screen_x, screen_y, screen_width, screen_height);
myGraphics3D.render(myWorld); // myWorld is a tree of 3D Objects (Scene Graph)
myGraphics3D.releaseTarget();

// print the scale/position/...
...
g.setFont(font);
g.drawString(scale_str,scale_pos_x,scale_pos_y,Graphics.BASELINE |
Graphics.LEFT);
...
flushGraphics(); // if you don't use GameCanvas...

Another solution is to use Java2D OpenGL pipeline when the JSR-184 is enable ;)

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6309763 (a good explanation)
http://weblogs.java.net/blog/campbell/archive/2005/09/java2djogl_inte_1.html

We will lost the control on the flushing step and this implementation
will depend of Java 1.5 but it will be faster ;)

I will try to build a first version this weekend...

Thank you for your feedback and good work with android ;)

Francois

Bartek Teodorczyk

unread,
Apr 25, 2008, 2:27:34 PM4/25/08
to microemulato...@googlegroups.com
On Fri, Apr 25, 2008 at 7:49 PM, François Weykmans <fan...@gmail.com> wrote:
>
> On 25/04/2008, Bartek Teodorczyk <bar...@barteo.net> wrote:
> >
> > On Fri, Apr 25, 2008 at 2:21 AM, Francois Weykmans <fan...@gmail.com> wrote:
> > >
> > > Hi,
> > >
> > > I would like to be able to show a mapping application (J2ME) using
> > > JSR-184 on MicroEmulator (JWS/Applet)
> > >
> > > But after looking for a open-source implementation of JSR-184 on top
> > > of J2SE, I found some converters for the M3D file format but nothing
> > > else...
> > >
> > > The JSR-184 specification is clear and well documented and it seems to
> > > be feasible to build a "basic" implementation on top of JSR-231 (Java
> > > Bindings for OpenGL) by using JOGL.
> > >
> > > JOGL : https://jogl.dev.java.net/
> > > JOGL - Javadoc : http://download.java.net/media/jogl/builds/nightly/javadoc_public/
> > >
> >
> >
> > It would be great to have such a implementation in Microemulator.
> > JSR-184 is a required element of JSR-248 (MSA) and our long term goal
> > is to be JSR-248 compliant.
> >
> Wow, You are ambitious ;) and JSR 226 (SVG) will be a big challenge!
> (maybe by using a lightweight version of Batik SVG Toolkit ?)
>

Recently we started working more closely with Apache Harmony, and it
is highly possible that Microemulator "migrate" to the Apache in the
long run. It means also there are more people working on Java ME. This
implies special licensing treatment for Microemulator, right now all
new code is dual licensed (LGPL, AL2). If you consider further
contribution to the Apache Harmony, you have to follow and sign couple
of documents:
1. Software Grant (http://www.apache.org/licenses/software-grant.txt)
2. ICLA http://www.apache.org/licenses/icla.txt
3. ACQ http://harmony.apache.org/auth_cont_quest.txt

Java 1.5 is not a problem, I guess we can bump Java version
requirement from 1.4 when running Microemulator in Java SE
environement.

Is it possible to modify JOGL not to loose control on the flushing?

Regards,
Bartek

François Weykmans

unread,
Apr 25, 2008, 5:29:41 PM4/25/08
to microemulato...@googlegroups.com
Ok, I will read these documents in deep ;)

Another (small) issue: The License Agreement of JSR 184 (the JSR is
owned by Nokia) don't allow an implementation to claim as "JSR184
compliant" before passing the technology compatibility kit (TCK) :

"Subject to the reciprocity requirement set forth below Specification
Lead also grants You a perpetual, non-exclusive, worldwide, fully
paid-up, royalty free, irrevocable limited license (without the right
to sublicense) under any applicable copyrights or patent rights it may
have in the Specification to create and/or distribute an Independent
Implementation of the Specification that: (a) fully implements the
Specification without modifying, subsetting or extending the public
class or interface declarations whose names begin with "java" or
"javax" or their equivalents in any subsequent naming convention
adopted by Specification Lead through the Java Community Process, or
any recognized successors or replacements thereof; (b) implement all
required interfaces and functionality of the Specification; (c) only
include as part of such Independent Implementation the packages,
classes or methods specified by the Specification; (d) pass the
technology compatibility kit ("TCK") for such Specification; and (e)
are designed to operate on a Java platform which is certified to pass
the complete TCK for such Java platform. For the purpose of this
agreement the applicable patent rights shall mean any claims for which
there is no technically feasible way of avoiding infringement in the
course of implementing the Specification. Other than this limited
license, You acquire no right, license, title or interest in or to the
Specification or any other intellectual property rights of the
Specification Lead."

PhoneME Feature MR2 have the same issue...
https://phoneme.dev.java.net/content/phoneme_feature_r2.html

"It is required that some JSRs be made available only in a compliant
state. Therefore, implementations for these JSRs may not appear until
they are TCK-compliant. JSRs that fall into this category for MR2
initially include: 75, 82, 179, 180, 205, 226, 229, and 238."

The workaround is maybe to say : "a partial implementation of JSR-184"
anyway it will be true for a long time I think... ;)

In a first time by using :
off screen buffer (VRAM) => java.awt.image.BufferedImage =>
javax.microedition.lcdui.ImmutableImage =>
javax.microedition.lcdui.Graphics

(Like i can read, I can use
DeviceFactory.getDevice().getDeviceDisplay().createImage() to create
my javax.microedition.lcdui.Image)

And after by enabling Java2D OpenGL pipeline and using a event-drive
flushGraphics();

I will also read the MicroEmulator's source code in deep :-)

Best regards

Francois

Reply all
Reply to author
Forward
0 new messages