Slashdot Mirror


A Look at Java 3D Programming for Mobile Devices

An anonymous reader writes "IBM developerworks is running an article that describes the Mobile 3D Graphics API and introduces you to 3D programming for Java mobile devices. Sony's PSP has shown the graphics power you can put into a mobile device and mobile gaming. Although the average mobile phone is technologically behind this specialized game machine, Java seems to be helping to drive the market in a very definite direction."

19 of 196 comments (clear)

  1. Hello World by deltalimasierralima · · Score: 4, Funny

    Wow! Finally I can code 'Hello World' in full 3D glory with realistic 3D shadows!

    1. Re:Hello World by Jekler · · Score: 4, Insightful

      It's a common myth that Java is slow. Modernly, Java applications are (on average) only 10% slower than an equivilant C++ application. With appropriate optimization, that margin is even smaller. Even then, when it comes to 3D rendering, the application is usually running at the speed of the hardware, with the Java code not really even coming into play. In a 3D environment you could say the performance margin can be less than 1% difference.

    2. Re:Hello World by Jekler · · Score: 4, Insightful

      I'm far from a Java zealot. I'm a programmer, language is an insignificant issue. The fact is, I've done most of my programming in C++. I avoided Java for precisely the reason that I thought it was much slower, and as it turned out a lot of my assumptions were wrong. It's even fast enough for 3d games, like Megacorps Online http://www.megacorpsonline.com/game/

      I know how to use plenty of languages, I learn new ones all the time. I wasn't just guessing the execution speed of Java, I was speaking from experience. As for the test code you use to show Java is slower, that's a huge mistake. You've composed a test which is ideal for C++ to execute. That's like proving a jeep is faster than a porche by doing time trials in offroad terrain. Given a more abstract problem than "Go through these loops a billion times", the solution in Java wouldn't even resemble the equivilant solution in C++. You can't approach the same problem identically in both languages, if you do, you're not writing Java code, you're writing C++ code in Java.

      There's a lot of utility code that would be necessary in a C++ program that's not necessary to perform the equivilant task in Java. Each language isn't just different syntax, you need an entirely different way of thinking. Trying to port a solution line for line into a different language is senseless.

    3. Re:Hello World by Jekler · · Score: 3, Insightful

      I apologize, what I said could be wrong. The test may not be more suited to C++ than Java. Truthfully, a short test like that could favor either language or neither. It's too small of a test to be a significant benchmark of a language. If you could test the performance capabilities of an entire language with half a dozen lines of code, no one would ever create an entirely new language until they found a way to execute 4 lines of code faster.

      The test given doesn't bring into a single feature that's unique to any language. It tests the execution speed of a loop and the increment/decrement of primitive types which is likely to be equally fast/slow in any language as it just comes down to the processor speed. To test Java as a language, a good start would be testing the creation of objects, allocating and deallocating arbitrary amounts of memory, and calling random methods on randomly sized objects.

      Objects and memory management is where Java shines. Many tests that compare Java's speed to C++ speed tend to focus on areas where C++ shines and Java performs poorly, like resizing containers.

      One reason Java really shines with objects is that Java doesn't run into the performance overhead incurred by copy constructors. There are a lot of situations in which Java will perform more slowly than C++. There are also situations where Java performs better. The end result is that Java's performance and C++'s performance can't be compared based on a single test. Many people craft a single test and based on the results of one test they brazely declare that Java is always slower. If, one day, it was 100 degrees in NYC, and 90 degrees in Las Vegas, one wouldn't say it's always hotter in NYC. By the same token, you can't compare language performances with a single test. The only real way to compare the performance of two languages is to actually spec a real-world program and have two teams go about building it in different languages.

  2. Sony Ericsson phones by wertarbyte · · Score: 5, Informative
    --
    Life is just nature's way of keeping meat fresh.
  3. 3D Handsets by seanellis · · Score: 5, Interesting

    Quite a few handsets already support M3G, among them the Siemens S65, Motorola E680, E1000, V980, SonyEricsson V800 and K750i, and the Nokia 6630 and 6680.

    M3G is a lot lighter weight than Java3D, has high and low level APIs, and has its own compact file format for efficient packaging of assets.

    I've been developing M3G technology, both engines and games, since day 1 (I was our company's representative on the expert group), and I am happy that Slashdot has at last highlighted it.

    If you think retreads of "Mr. Do" and "Snake" are going to cut it in the Java space from now on, think again. You might like to look at Superscape's site for a taste of the kind of 3D games that are already out there.

    Developers might also want to visit Benhui.net's 3D Developer Forum.

    1. Re:3D Handsets by seanellis · · Score: 3, Insightful

      The comparison with the PSP was in the original link, not my post. These are very different games on very different platforms.

      On the one hand, we have the PSP - an ultra-slick, hardware-accelerated, single-purpose device which is excellent at playing action games.

      On the other, we have almost-ubiquitous Java handsets (here in Europe, anyway), with enough processing power to run simplified versions of the console games. That is a niche begging to be filled.

      The hardcore g4merz will have a PSP. And probably a GBA, a GBM and an Atari Lynx just in case. Everyone else will have a cellphone. They are very different markets and will have very different expectations and different needs.

    2. Re:3D Handsets by mwvdlee · · Score: 4, Interesting

      Yes, I know most gamers have mobile phones.

      Did you also realize that practically the rest of the civilized world also has mobile phones?

      Gamers are but a small percentage of the mobile phone users.

      Especially when using "gamer" in the popular interpretation as one who primarily plays games in the popular (racing, FPS and sports) genres.

      I consider a fanatical phone user, a person who will frequently use SMS, MMS, WAP, built-in cam, built-in MP3 and in general know more than the manual does about the phone. By definition, these are people who are more "on-the-road" than a typical gamer and thus less likely to be a gamer. Apparently conventional popular game genres did not attract them enough to shift from being a hardcore phone user to becomming gamers. Logically, this means that such games would not attract them on their mobile phones either.

      Perhaps you should refrain from smoking anything for a while, might help you to actually understand what you're reading. ;)

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
  4. Just reminds me by olddotter · · Score: 4, Insightful

    I have a freind who used to work at a major cell phone company. I remember him telling me people would NEVER use java or linux in embedded products because the memory foot print was just too big.

    Ah, Moore's Law, what isn't practical today will be in 18 months (or 36 months, etc.).

    He is a smart guy, he just doesn't have the vision to look out that far into the future.

    1. Re:Just reminds me by LarsWestergren · · Score: 3, Insightful

      Motorola now use the "JUIX" operating system which is a combination of Linux and Java so while he was definitely wrong, his mistake was simple enough - assuming that technological superiority would win out over mass-market/buzzword appeal.

      Ease of development, maintainability and porting are also forms of technological superiority, and in this case perhaps more important than pure performance?

      --

      Being bitter is drinking poison and hoping someone else will die

    2. Re:Just reminds me by Bogtha · · Score: 3, Insightful

      I remember him telling me people would NEVER use java or linux in embedded products because the memory foot print was just too big.

      Java was designed for embedded products.

      He is a smart guy, he just doesn't have the vision to look out that far into the future.

      Or the past, apparently.

      --
      Bogtha Bogtha Bogtha
  5. Bad Idea! by Agret · · Score: 3, Insightful

    3D Java Games? Anyone re-call the N-Gage?

    This seems like a bad idea to me. Instead of trying to make a phone compete with a gaming console they should be looking for more innovate things that they can make phones do.

    --
    Have you metaroderated recently?
  6. How much would a phone.. by CyricZ · · Score: 4, Insightful

    How much would it cost these days for a phone that did not have any unnecessities like 3D graphics, address books, calendars, clocks, and so forth? I'm talking about a cell phone equivalent feature-wise to your typical 1960s telephone. How terribly cheap could something like that be produced for? I'd almost be inclined to think that you could find them in vending machines.

    --
    Cyric Zndovzny at your service.
    1. Re:How much would a phone.. by eneville · · Score: 3, Insightful

      ebay for the nokia 8310! It's still one of the smallest and useful phones.

  7. And queue the Java-being-slow comments... by MaestroSartori · · Score: 3, Insightful

    ...even though back in 2000 I wrote a 3D software engine in Java that was more than acceptably fast enough to run Wolfenstein-quality gfx on a P75. And I knew fairly little about optimisation in Java, so that could probably have been faster. Throw in hardware acceleration, and you can bet these'll be fast enough for at least ok game-level graphics. Beyond games, I don't know what use this would have...

    1. Re:And queue the Java-being-slow comments... by vidnet · · Score: 3, Interesting

      For a taste of what java can do, try Jake2. It's a Quake2 engine written entirely in java (easily started via webstart, on both linux and windows, and automatically downloads the Quake2 demo files if you want).

      You would never be able to tell that it's java.

  8. Explain this to me by RootsLINUX · · Score: 3, Insightful

    Why would I want (or even care) to have 3D graphics on my mobile phone/device? The screen is already tiny. I'm sure 3D graphics are more computationally expensive and power-consuming than traditional 2D graphics. And in the end, I'm still just looking at a 2D projection of a 3D image. Its not like I want to be playing Half-life or another FPS on my cellphone. I'm sorry but this just seems stupid to me and I get the feeling that the only people who will want this "feature" will be the hard-core tech gadget geeks out there. Does a 3D API bring *anything* useful to the mobile table???

    --
    Hero of Allacrost, a FOSS RPG for *NIX/*BSD/OS X/Win
  9. Neat article by LarsWestergren · · Score: 3, Interesting

    I have some friends who are working with developing Java games. So far the big money is not in developing titles for phone companies portals (or even worse trying to sell them to the end user yourself) but to develop ad games for companies who make them available for free downloads, usually as a part of a competition.

    From what I understand, the best part of the job is that since graphics on mobile phones and other limited devices are so cruddy development focus tends to be on addictive gameplay rather than eyecandy. It is also still possible to be a small independent game studio, no need for a big art studio to render hours of CGI, etc.

    Worst part is that just about all phone developers are very sloppy when it comes to implementing the J2ME standards and all models tend to have their own quirks. Sony Ericsson and Nokia are probably the best, but that is not saying much. So in this case, it really is "write once, debug everywhere" type java.

    Mobile gaming is really taking off, I read on GameDev for instance that mobile game developers Gameloft increased their workforce from 432 to 1375 employees.

    --

    Being bitter is drinking poison and hoping someone else will die

  10. Re:A very definite direction by LarsWestergren · · Score: 3, Insightful

    Java is in no way driving 3D games development - on mobile platforms or otherwise, this is just a bizarre article.

    They don't have to "drive" 3D games development, they just have to be fun enough that people with mobile phones want to play them.

    There are currently zero mobile Java games available that compare even remotely favourably to a decent GBA title, let alone with any titles available on the DS or PSP.

    Oh, I agree DS or PSP games are more fun, it would be strange otherwise since they are dedicated gaming machines. Thing is, there are many millions more mobile phones sold. Not all people are hardcore gamers who are willing to pay for one of those devices. Some just want a few minutes of diversion while on the bus. A Sudoku puzzle or similar. And this article shows that these games are getting better and better.

    Typically, the frame rates are awful, the interfaces are not responsive, the sound is often out of sync and of poor quality (as are the often tiny sprites).

    That is just FUD. I have played plenty of fun and responsive Java games. Still, it must be said that more developers should focus on making addictive puzzle games or similar rather than action games. As you point out, the processor, the screen and the input possibilities are by necessity rather limited.

    --

    Being bitter is drinking poison and hoping someone else will die