A Look at Java 3D Programming for Mobile Devices 196
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."
Hello World (Score:4, Funny)
Re:Hello World (Score:5, Insightful)
Only for JIT VMs (Score:2)
with JIT systems for 101 different CPU types out there that the
phones use? Pretty slim I reckon. So it'll be a standard
interpreter type JVM with the accompanying slowdown.
Re:Only for JIT VMs (Score:2)
Re:Only for JIT VMs (Score:2, Informative)
http://www.arm.com/pdfs/JazelleWhitePaper.pdf [arm.com]
The real ARM instruction set is nothing like Java BTW, it's a slick Risc chip where all instructions are conditional, and you get shifts for free, whereas the Java VM is stack based.
http:// [wikipedia.org]
Re:Hello World (Score:3, Interesting)
Re:Hello World (Score:5, Insightful)
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.
Re:Hello World (Score:2)
The example I provided was, in no way, tailored to C++. If you're doing scientific computing, or graphics programming you can't get away from doing tight loop calculations. Many (ie almost all) of the graphics algorithms are O(n^3) or higher!.
You obviously ARE a java zealot or you wouldn't be outright lieing just t
Re:Hello World (Score:2)
YOU are the Zealot newbie.
Re:Hello World (Score:4, Insightful)
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.
Re:Hello World (Score:2)
You going to conclude that you've proved Java faster now?
Re:Hello World (Score:2)
Plus of all the cross language linking I've seen (C++/Python/C/.NET) it is by far the ugliest to write.
The folks who designed Java are almost religious in their beliefs. I would not be suprised if they made JNI deliberately ugly and slow to discourage people to not to write in Java, the language they spend so much on marketing a
Re:Hello World (Score:2, Insightful)
I agree with most of what you're saying but I do think that rallying
around a standard also has it's advantages. That's why C became such
a reference point for scientific and engineering software. It works
and it's ubiquitous (available everywhere). Java is similar. It has
many problems too (like every language) but if Computer Scientists
and programmers rally around Java as a language of choice it will
contin
Re:Hello World (Score:2)
Java:
C++
Re:Hello World (Score:2)
Try again next time.
Re:Hello World (Score:2)
You lying piece of shit - I've just compiled the fucking results and run them right now. There are two other people who have posted similar results - are they lying too?
Fuck you and fuck the horse you rode in on you mother fucking slashbot moron. I've been coding in C for two fucking decades and I'm not about to take shit from know-nothing newbies like you.
Re:Hello World (Score:2)
It's benchmark numbers.
How can actual timings be Flamebait? I've run the tests on windows and gotten similar results.
Moderators using mod points to avoid FACTS they don't like should not have mod points. That's just abusing the system.
Re:Hello World (Score:2)
Even including the JVM start up speed, java was faster.
Re:Hello World (Score:2)
Proof is in the real-world applications, not arbitrary micro benchmarks.
Re:Hello World (Score:2)
There's literally tens of thousands of sources on the internet about java's execution speed and the myth of it all. Do some friggen research, what do I actually care if you believe it or not?
People wildly claim that Java is X amount slower than C++. I'm pointing out that it's not true. I guess the most mind boggling thing to me is that everyone is so skeptical about it, like if Java's execution speed approached the speed of C++ armag
Re:Hello World (Score:2)
Chrome
Law and Order II
Kingdom of Wars
Alien Flux
Star Wars Galaxies
Pernica
Command & Conquer Attack Copter
Roboforge
Runescape
Wurm Online
You Don't Know Jack
Vampire: the Masquerade Redemption
Source http://fivedots.coe.psu.ac.th/~ad/jg/ch00/ch00.pd f [psu.ac.th]
Although not all of those are completely coded in Java (some of them use Java and C++ both), many of them are.
Sony Ericsson phones (Score:5, Informative)
3D Handsets (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 [superscape.com] 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 [benhui.net].
Re:3D Handsets (Score:3, Informative)
http://www.superscape.com/games/title.php?SB_3D,s
http://www.1up.com/do/media?cId=3142148 [1up.com] PSP Basketball game
Re:3D Handsets (Score:4, Insightful)
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.
Re:3D Handsets (Score:2, Troll)
Seriously, these games look like something a Sega Genesis would be able to do.
IMHO, the only games that really work on mobile phones are games which do not require any timed action, because the controls on phones just totally suck! This still leaves a lot of genres like RPG's, turn-based (and perhaps slow real-time) strategy games, puzzle games, adventures and board games, sims (think tamagotchi/nintendogs), yet we see VERY litt
Re:3D Handsets (Score:2)
I don't know what you're smoking but I want some! Every 'typical' gamer I know has a mobile phone, and many of them are also into games on their phones.
Re:3D Handsets (Score:5, Interesting)
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.
Re:3D Handsets (Score:2)
Pocket Quake [pocketmatrix.com]
Or, you could try Quake III [noctemware.com], which is pretty new. Only 5fps at the moment, but they are starting to add support for GFX chips, that ought to bring it up to spec.
Not a fan of FPS on the mobile to be honest, mouse beats joypad, and joypad beats phone keypad. Gimmie Tetris on the gameboy emulator, or perhaps Age Of Empires for most of my mobile gaming.
Re:3D Handsets (Score:2)
Re:3D Handsets (Score:2)
Not quite. A section of the screen was set aside for it. Not tried any of the ports recently, might give it another blast, I think it was an alpha/beta copy I tried. Took up a lot of storage space, so it got ditched after the initial "neat" factor had worn off. ;-)
Re:3D Handsets (Score:2)
Looks like poorly disguised retreads of Qix [superscape.com] are fine, though?
Oh wait, it's got a hot girl in a bikini in it! Feel that innovation! Tssssssss!
On a phone screen even Mr Do looks crap (Score:2)
something a few inches square? OMG! WATCH OUT FOR THE
pixel squidge coming at you
Just reminds me (Score:4, Insightful)
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.
Re:Just reminds me (Score:3, Interesting)
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 technologic
Re:Just reminds me (Score:4, Insightful)
Ease of development, maintainability and porting are also forms of technological superiority, and in this case perhaps more important than pure performance?
Re:Just reminds me (Score:2)
Maintainability - nearly all widely deployed Java apps are riddled with #ifdefs done using a custom pre-processor, because phones vary so wildly in bugs and capabilities that you have to produce many JARs from the same source code. Java the language provides zero help wi
Re:Just reminds me (Score:2)
Opensource 3D on every phone ? possible (*caugh* ) (Score:2, Interesting)
with my embryonic diet3d library :
http://rzr.online.fr.nyud.net:8090/java.htm [nyud.net]
OK lot of work to be done to be M3G compliant... (btw, i am open to contribs)
But what is bugging me : is J2ME the only alternative to WinCE or symbian ?
since most Linux handset doesnt not provide other API (beside QTopia and his friends)
Re:Just reminds me (Score:4, Insightful)
Java was designed for embedded products. [wikipedia.org]
Or the past, apparently.
Re:Just reminds me (Score:2)
Re:Just reminds me (Score:2)
3D programming and multiple screens on my sony (Score:3, Interesting)
Bad Idea! (Score:4, Insightful)
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.
Re:Bad Idea! (Score:2)
3D games are not necessarily console games. 3D, like vector graphics or color screens, is another tool for the game developer to use. And you use the tools you have to get the best out of the platform you're on. More tools at your disposal should be better for the game developers, and that impacts consumers positively too.
Re:Bad Idea! (Score:2)
How much would a phone.. (Score:5, Insightful)
Re:How much would a phone.. (Score:3, Insightful)
Re:How much would a phone.. (Score:2)
Actually, this isn't really a fair comparison - the simple phone was bigger and had a much larger screen, which is a big part of the material cost on a phone.
Re:How much would a phone.. (Score:2)
Re:How much would a phone.. (Score:2)
Given a display, number keys and telephone connection, which most people would regard as necessities for a mobile phone, you basically get the address book, calendar, clock and Tetris for free. (How long do you think it takes a devloper to code a calculator or an alarm function?) I suppose that if you were willing to ditch the display, you could save, oh, four
Re:How much would a phone.. (Score:2)
Modern cell phones do most of their signal processing in software, so they have to have fairly beefy processors to begin with. So they basically already have the hardware to handle everything you mentioned. They're just trying to get the most use out of the hardware.
I don't know about GSM but with CDMA the clock needs to be accurately sync-ed to the network for communication to occur. So they just wrote a small program to display the time.
3D graphics could be easily implemente
cost about the same ... (Score:2)
They would cost about the same.
... if measured by money.
But IMO it isn't true if we measure the "price" in time or nerves you spend "wrestling" with you "smart", "feature packed" and whatever phone while trying to make something which should be easy on the mobile phone, like making a call or sending a text message. :)
Because I suspect software for phones (that part of software which we can call "smart", i.e. not that part which handles signal processing etc. but those calendars, games, address books, .
Re:How much would a phone.. (Score:2)
Re:How much would a phone.. (Score:2)
Re:How much would a phone.. (Score:2)
LS
Re:How much would a phone.. (Score:3, Informative)
Does nothing but voice and SMS.
Costs ~£20 on PAYT. That's ~USD$40.
Re:How much would a phone.. (Score:2)
And queue the Java-being-slow comments... (Score:4, Insightful)
Re:And queue the Java-being-slow comments... (Score:2)
Re:And queue the Java-being-slow comments... (Score:2)
Bear in mind I didn't claim it was well designed, extendable, or remotely worth using for anything other than a demonstration...
Re:And queue the Java-being-slow comments... (Score:2)
Re:And queue the Java-being-slow comments... (Score:2)
Re:And queue the Java-being-slow comments... (Score:2)
Re:And queue the Java-being-slow comments... (Score:4, Interesting)
You would never be able to tell that it's java.
Re:And queue the Java-being-slow comments... (Score:2)
first off, i love java, and its use has employed me for >5 years now. and i agree that with modern JIT compilers, the language itself is pretty damn fast. not C fast, but pretty damn close to C++ fast. that being said:
for graphics, it still sucks. Swing is slow. SWT is better, but not great. JOGL is coming along, but immature. use java for server-side programming. that's where it kicks ass.
second...wolf3d ran on my 286! in 1990!!! arguing that java isn't slow by claiming t
Re:And queue the Java-being-slow comments... (Score:3, Interesting)
Re:And queue the Java-being-slow comments... (Score:2)
Sun must have put a lot of effort into the hotspot compiler, but its performance gains come at the expense of a lot of memory usage.
Re:And queue the Java-being-slow comments... (Score:2)
Re:And queue the Java-being-slow comments... (Score:2)
Re:And queue the Java-being-slow comments... (Score:2)
Re:And queue the Java-being-slow comments... (Score:2)
Explain this to me (Score:4, Insightful)
Re:Explain this to me (Score:3, Informative)
They've reached a point where basically everyone has a cell phone that does everything they _need_ it to do. Now they need to start throwing in gimmicks like this to get people to upgrade. This is especially true for the "teenyboppers" or "hardcore gamerz" who are easily amused by gadgetry such as this. Chances are there'll be many 13-year-old boys and girls begging their p
Re:Explain this to me (Score:2)
One of the things that the M3G group was very careful about, though, was to ensure that it wasn't "just" a game engine. It's a fully-featured 3D engine which means that developers can use it for whatever they want.
Obviously, games are likely to always be the most popular application, but others are possible.
Re:Explain this to me (Score:2)
My V220 won't boot anymore [never hooked it up to the USB] after I deleted the annoying backgrounds/java games/etc off the phone. Me thinks it deleted something more important... I'd rather have simpler phones that are less likely to screw up in this way.
And of course, there are a million "rogers" booths [my provider] in every mall, corner plaza, etc. Except when you go in there their only mission is to sell you NEW PLANS. They don't care about service or maintenance.
Well
Re:Explain this to me (Score:2)
I don't think you made an insightful comment.
We already knew there were lots of people who didn't care about 3d on their phones. Move along. Nothing for you to see here.
At least you are not one of those whiners who complain about bad service and say that R&D should go into improved their flawed voice phones, instead of useless features.
This is an article for _developers_ who _do_ care about 3d in phones. Maybe _you_ don't have an obvious application for that. Some other people might.
Gaming on the Phone !? (Score:2, Informative)
Neat article (Score:4, Interesting)
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 [gamedev.net] for instance that mobile game developers Gameloft increased their workforce from 432 to 1375 employees.
Re:Neat article (Score:2)
And this actually really says it all. Most of the effort of doing a J2ME game seems to go on making it work on various devices and conform to operator wishes (and they are plentiful and vary a lot).
Java! That's the answer! (Score:3, Insightful)
There are so many people (me included) who would love to be able to program for the PSP, but they won't open it up for various reasons (fear of piracy, mostly).
So why not give people a Java sandbox (J2ME would be fine) to play in? That way they can make games and other fun things, but they won't be able to use it to boot pirated games off memory sticks and such (unless they REALLY mess up the JVM). Seems like a perfect solution.
They sold the Net Yahorzee, why not give us this? Download a copy today (tied to the PSP's serial number to prevent copying?) for only $20! They'd make a fortune.
Re:Java! That's the answer! (Score:2)
If anything they should open the platform up. Not like people are not going to buy things like GTA PSP or whatever just because a tetris clone exists. It would get more people in contact with the PSP which will drive up the demand for it.
If course you have to think outside the box for that...
Tom
Re:Java! That's the answer! (Score:2)
As the processor and memory, they will take a hit from running Java but it would still be WORLDS ahead of what even high end cellphones offer. More than enough for most homebrew games and platformers and other fun stuff. Plus you've got the fast 3D hardware which could be exposed (either though Java3D, or a JNI thing for better performance).
I thought of
Re:Java! That's the answer! (Score:2)
Even in the GBA scene most people don't pirate games despite the fact it's very simple. In fact of all the places I've been *I've* been the only person with a flash cart. All the peeps in airports and on trains I've seen have had legit games.
The homebrew scene is just that, hobbyists. When it comes down to it the vast majority of people still go out and buy games.
Tom
Re:Java! That's the answer! (Score:2)
It's not an issue of reality, it's an issue of business.
But like I said, they could also give a managed environment like the PS2 had with Linux.
Re:Java! That's the answer! (Score:2)
I mean I can rent games at blockbuster for 5$, rip the game to my HD and then use my flashcart to play the game whenever I want. I don't because it's not worth the trouble. What I do use my gba carts for [other than programs I write myself] are things like PocketNES.
But the p
Re:Java! That's the answer! (Score:2)
You know what works well for a cell phone? Proper software development made possible by not budgeting engineer time on frivolous BULLSHIT features.
Tom
Re:Java! That's the answer! (Score:2)
1. Is easy, licensing cost. You can't make UMD discs, you're not allowed to put games on UMD discs, you can't sell them. Sony can, and they will sell each and every one of those discs to
Who uses their mobile phone for games? (Score:2)
My only objection is that I do not like playing games on a tiny screen using tiny buttons. Since most games nowadays are not just 'steer and shoot,' the complexity of the controls and intricacy of the graphics plays into the overall fun of the game.
I applaud the efforts to get better 3D graphics for mobile devices, but I don't think I will ever be wasting my time playing games on my cell phone. It is much more enjoyable to play a console system on a l
John Carmack (Score:2, Informative)
"The biggest problem is that Java is really slow. On a pure cpu / memory / display / communications level, most modern cell phones should be considerably better gaming platforms than a Game Boy Advanced. With Java, on most phones you are left with about the CPU power of an original 4.77 mhz IBM PC, and lousy control over everything."
Ha! 3D... (Score:2)
Right Tool for the Job (Score:2)
The problem with Java... (Score:2)
Perhaps I have misunderstood, but I thought that Java 3D made OpenGL calls under the covers. Is this the case. Java's fatal flaw has always been that it must use low level NMI modules written in C or C++ to get anything done. When Jim Gosling choose not to have pointers he basically decapitated the language. Therefore, all Java programs that need to manipulate memory mapped registers are a kludge by design.
3d user interfaces (Score:2, Informative)
It's not "Java3D", it's an OpenGL wrapper in Java (Score:2)
The base embedded subset of OpenGL leaves out display lists, any geometry more complicated than a triangle, and all the new programmable shader stuff. It's basically what an SGI machine had twenty years ago.
This may or may not be useful for cell phones, but it will
Re:It's not "Java3D", it's an OpenGL wrapper in Ja (Score:2)
The article in the original post is part 1 of 2. Part 2 will show the scene tree manipulation functions and the high-level stuff. This includes file loading, animation, alignment, etc.
Re:It's not "Java3D", it's an OpenGL wrapper in Ja (Score:2)
Scene graph systems are somewhat out of favor in the game developer community. They're not powerful enough to be a game engine, and they're overkill for a 3D drawing engine. There have been many scene graph systems, SGI's Inventor being the first big success. They're nice for simple little games, but they usually scale up badly. For the smal
Re:A very definite direction (Score:3, Insightful)
Java is in no way driving 3D games development - on mobile platforms or otherwise, this is just a bizarre article. It comes as no surprise to me the IBM/SUN employee who submitted this article wishes to remain 'anonymous'.
There are currently zero mobile Java games available that compare even remotely favourably to
Re:A very definite direction (Score:4, Insightful)
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.
Re:A very definite direction (Score:2)
I can honestly say that doesn't ring true for me at all. They've been out for years, and I keep seeing the same awful software at trade shows and developer conferences (where there is a lot of hype from vendors that don't seem to acknowledge reality).
That is just FUD. I have played plenty of fun and responsive Java games.
I'd really like to see you name some and link to them, even just 3 or 4, I'd really like to see some good examples.
I've