As part of my Software Applications module this year, I have a sub-module called Digital Imaging. Basically, we learned how to use Java3D to model things and then animate them.
The assignment set for this term was to create a wind turbineâ€¦
Above is what I created! Obviously you cannot see here, but the blades move round the appropriate axis, and the entire head of the turbine rotates around the Y-axis when you click on the mast. Pretty impressive â€“ huh?! I didnâ€™t think so either! If, for whatever reason, you do think itâ€™s impressive â€“ you may download the .jar file here. It will need Java3D and possibly some other stuff installed to run.
The main thing I learnt doing this was how much of a pain J3D really is â€“ itâ€™s a completely obsolete extension of Java that doesnâ€™t really have much use, apart from for making simple animations such as this one. I canâ€™t think of anyone who would use Java to make a serious 3D game, the processing power just isnâ€™t there to allow decent use of physics, lighting or anything else essential to make an immersive environment. For example, when I was trying to make the turbine cast a shadow on its environment, I found it wasnâ€™t just as simple as allowing the light source to throw a shadow onto the grass object â€“ oh no â€“ I had to calculate the exact shape that the shadow would be, based on the position of the light relative to the turbine, then draw it manually to the floor. As you can imagine, this would be a huge task â€“ and lets not even get started on running this 40+ times a second to get the moving blades, or even considering the opacity of the shadow in different places, or the fact that multiple light sources exist, or that the turbine would shadow itself in partsâ€¦
Iâ€™ve used programs before (GameMaker stirs a memory?) that will do all that for you in 2 or 3 lines of code, however in J3D I was looking at separate classes, and 2 or 3 times the existing code I had to make the turbine work. No thanks, Iâ€™ll just pretend it was a very bright day!
Iâ€™m quite glad Iâ€™m rid of J3D now â€“ Iâ€™ll be even happier when Iâ€™m rid of Java completely. Iâ€™d be really happy if I never had to see a wind turbine ever againâ€¦ but they had to go and drop that into our Software Engineering project as well. More to follow on thatâ€¦