Skip to main content
  1. Blog/

Windmills

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…

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…