I love classes like java.awt.geom.AffineTransform
. They’re awesome because they make me laugh and reassure me that I’ll never have trouble getting work.
That class confused the shit out of me when I was starting out…I mean, what the heck is an AffineTransform object? They say everything is an object, I can’t really imagine it as a manager, component etc :
One day the monkeys saw a giant black monolith in the middle of the canyon. Upon it was carved a single word, “Maths”.
They stood around, scratching their heads for a few minutes, and then started screeching and jumping in rage. Soon they had bashed the monolith into irregularly sized chunks, none of which would fit next to any other chunks ever again properly, and were sort of happy that they’d managed to object-orient the monolith.
Cas
That sounds like it could be a Douglas Adams quote.
But but it is not vanished, the smallest chunk should be still there :persecutioncomplex:
AffineTransform works fine. I got some pretty speedy animations running that used it. What’s the problem?
I like OpenGL Java2D is cool too. I don’t get all the angst - choose whichever you like.
It’s basically a 3x2 matrix class: look at the source of say “concatenate”.
I just started to port a game from Flash to Java and when I started to port the code I already knew that the rendering part should be separated as much as possible (which it should be anyway) so I could decide later wheter to use Java2D, opengl, a printer or whatever.
So in my opinion the question about wheter to use Java2D to make games or not should be wheter or not to use Java2D for the rendering.
Java2D is not about game programming, it is about image processing (which it seems to do very well).
It is perfectly valid to use Java2D for your rendering.
And if you have separated the rendering from the rest of the game it should be no problem to switch from the Java2D API to some OGL API.
Same applies for the inputs btw.
Java2D is so very very very limited. I can do image processing…slowly.
One of the big issues is not that it is super slow (which it is) but that the performance is inconsistent across systems. That is to say, on my desktop I easily get 5k sprites (64x64) but on my laptop due to crapy DX drivers, get fill rate limited after about 200 sprites at the same size. I could switch to the opengl pipeline which will fix the fill rate limit but gives all sorts of other issues. It is not consistent.
Using opengl, my laptop gets fillrate limited again but easily hits 10-20k sprites using glBegin glEnd. Adding basic sprite batching and bam! 50k. You also cannot do any cool effects such as lighting, additive blending, or the all powerful shaders without bashing your skull into the ground and sacrificing valuable processing time to try and hack java2d to get it to do what you want. Java2D was NEVER meant for games. It is not as simply as just rendering. Rendering eats into frame rate which logic needs.
If you want to make a game, then use a library/rendering method for games. whisper libgdx
If you insist on writing your own engine/lib/everything then break out some assembly or use opengl bindings.
If you STILL like java2d well then before you start asking all sorts of questions on performance and best method for rendering images, please read this.
Once you are done reading that, shoot yourself in the foot because that is what you are doing by using java2d for rendering
This.
I come from an OpenGL background yet I made it a point to make my first Java engine in Java2D (would have taken me less time and effort if I jumped straight to LWJGL).
My sole reason for using Java2D (aside from the fact that I was helping my nephew with his Java Graphing Assignment) is because it was fun learning it. ;*)
The older versions (before 1.6.0) of Java3D have the same kind of problems and Oracle is going to do the same mistakes with the 3D API of JavaFX.
I blame Notch.
I was all happy about choosing a good extension for game development, when, looking into Notch (because Minecraft) I stumbled upon his Left4kDead game, and from that went on to check the Java4k page, which lead me to think:
“All these cool games are being done in plain Java?”
“And they run fine?”
“And they take 4k?”
“…”
“…”
“I must learn to do this!” >:(
More seriously, I spent many years jumping from one framework/API/Tool to the next (bare OpenGL, Panda3d, Ogre3d, ACS, Unity…) and finally realized that I had no experience with the basics. So made the decision to buckle down, and strive to actually finish a project using no extras.
That doesn’t mean I don’t see the limitations, I’ve been tinkering with normal mapped lighting and blending modes recently and right now could punch the JVM in the face, but I still think it is a worthwhile exercise.
One one hand: Learn to crawl before you walk
On the other: The more you can do without extra tools, the better
I agree with you.
Personally, I would rather advise people to learn the basics before using high level APIs that hide most of the complexity. Extra tools can be useful to avoid reinventing the wheel as I explained here.
Yeah, I should have explained that better. I meant more or less that same thing. Understanding the basics makes using advanced tools even better.
Using the tired car metaphor, you don’t need to understand how the engine works, or the basic physical properties of the vehicle, but having an understanding of those, even a cursory one, will help when you come across unexpected issues.
I know plenty of people (and been one of them too) who jump on advanced tools from the get go, and then are stumped when they run out of tutorials for specifically what they want to do.
I’m going with the “doesn’t require signed applets” excuse. It seemed like a nice idea being able to deploy an applet without extra fluff that requires the user to sign off on scary security warnings.
Oh, and I’m ridiculously lazy.
Please, stop using applets
Cas
Yes please let us applets die.
The tribe has spoken. Applets, bring me your torch it’s time to go.
At first I prefered applet over webstart, until I can’t get libgdx/lwjgl applet work.
ALL HAIL PRINCEC!