3D Menu Library (With 3D Fonts!)

Nice thank you! I was actually going to do that, thanks a lot for saving me the trouble of searching for the right contact.

I’ll keep you posted!

You should ask but I strongly suspect that Harvey Harrison do not hold the copyright to the Java3D code (the license says it is Sun Microsystems). So Harvey can most likely not negotiate any license change or re-license the code in any other way than allowed by GPL 2.

I’ve sent a mail, summing up all the question raised this far, and proposing a range of solutions.

Guess we just have to wait. Good night!



Edit:

I’ve got a reply! Basically, Harvey does indeed not own the copyight and can do nothing concerning license changes and exceptions, and that Oracle is not very responsive about Java3D, but he also told me this:


Take with a grain of salt, but my impression is that the classpath exception allows you to bundle java3d libs with your program, each part under its own license. (you are still required to maintain your obligation under the GPL for the Java3d parts).

As long as you stick to the public API of the Font3D class and do not subclass any of the java3d objects in your code, you should be OK....to be fair, I'm really not that clear on just _what_ the classpath exception actually means in a user-distributed program, so follow this advice
at your own risk.


I must say I agree. The GNU Classpath page says:

When GNU Classpath is used unmodified as the core class library for a virtual machine, compiler for the java languge, or for a program written in the java programming language it does not affect the licensing for distributing those programs directly.


Re-Edit:

The actual Java3D Licence seems actually ok by. I think I'll go with that and assume it's ok.
1 Like

Hopefully someone will eventually make a 3D font that is unencumbered by both licensing and being a part of a larger inseparable bundle, though. I wish that I had the time as it’s a fairly straight-forward thing to do.

I’ve tried, and I’ll describe it as anything but straightforward! :stuck_out_tongue:



There are simple algorithms for triangulating convex shapes, but it was a nightmare on “hollow” characters, such as ‘O’ or ‘B’ - or about 50% of our glyphs.

Not speaking of disjoint shapes ( Ë )…

I don’t remember the specifics but if you turn the font into a Java2D path then you can render the segments… no need to worry about hollow shapes or whatever. I’d have to reboot parts of my brain to fully recall how to do it.

Indeed, but from the segments, you need to create triangles. This problem is non-trivial and requires a complex method, such as Delaunay tirangulation.

But I might - and would like to! - be wrong

I’m not sure why Delaunay gets involved. You have segments that are either straight or curved. For flat polygon text, the straight ones become quads and the curved ones can follow a fixed pattern of triangles depending on the length of the curve and the desired resolution. Or you just calculate an outer and an inner curve and connect them like quads. You could also plot the curves by chopping them up into straight sections and passing them to the regular straight segment bit. Each new path segment can start with the two end points of the last segment.



From there, extruding this is not hard, either.



For round fonts (like made from pipes), it’s not much harder. Each segment joins to the last by “rotating” the ends to bisect the angle between them. Rotate the normals too if smooth bends are desired. There is a handy formula for this but it escapes me at the moment.



At least, that’s what my memory tells me. I feel like I did this once for work but I can’t recall what the situation was… but the Java2D api and algorithm is embedded in my brain for some reason.

The problem I had it that, for example for a ‘O’, there was a single general path (at least that’s what I got from AWT font, getting a GlyphVector then a Shape).

It was possible to separate the two parts, but basically it was the path of the outer contour of the shape, and the path of the inner contour; not the path the pen would take to draw this letter. This was not the right way then.



Anyway, having read licenses and explanations of the “Classpath Exception” all day, I’m pretty confident and will go with my 3D Library. If indeed you or anyone can do the mesh triangulation by themselves, I’ll be very glad to switch to that method.

@carpentier-ch said:
The problem I had it that, for example for a 'O', there was a single general path (at least that's what I got from AWT font, getting a GlyphVector then a Shape).
It was possible to separate the two parts, but basically it was the path of the outer contour of the shape, and the path of the inner contour; not the path the pen would take to draw this letter. This was not the right way then.


For the record, I now think we were doing the outlines. You are right that the font will present outlines... properly wound for rasterization. You can still do it without Delaunay but it is not as straight forward as just tracing the paths. Someday, if I have time I may play with this.

I’ve updated the lib, added carousels and cleared the code a bit.

http://code.google.com/p/jmonkey-3dmenu/downloads/list

2 Likes

I’ve always thought this project to be cool, but never really got where I could use it, but here’s an idea: Trailer! :smiley:



Yeah, there’s probably 10 posts on this. #latetotheparty :stuck_out_tongue:

I’ll do that when I have enough stuff - and less bugs :slight_smile:

In the meantime, the jar is launchable and provides a quick example, with a button, a carousel, a transition to another panel with a transparent slider!

I actually meant that for my own project. :wink: