Macguyver’s Shack, Raytracer Improvements

I’ve not been completely idle these past few days, despite “being on holidays” from University until next semester starts in 2009. On Monday and Tuesday, my friends and I undertook some work from my microprocessors lecturer to design and build some low-cost educational robots for use in schools to get young students interested in the world of electronics.

We ended up with two prototypes, a submarine built by myself and my friend Luke, and a obstacle avoidance robot built by my friends Alan and Jim. Both are made from cheap components (PVC tubing, foam, film canisters, hobby motors, etc.) and are specifically designed to be educational rather than amazing feats of engineering. The submarine shown here uses three hobby motors mounted in film canisters and sealed with electrical tape, petroleum jelly and blue-tack for propulsion and dive/surface control:

Pictured without the right propellor, as we only had two at the time, and were testing the third (dive/surface) motor when the photo was taken.

The second model to come out of what can only be described as a Mythbuster’s lab was the avoidance robot, pictured below. Built using a CD as a base with small Perspex wheels lined with rubber bands for traction, it ended up working reasonably well, for a design with zero components other than batteries, micro switches and motors. Of course, I was itching to put in an ATTINY to make it somewhat intelligent, but alas that was out of the project’s complete-beginner scope.

Aside from the above, I’ve also been busy working on some more contract work over at the local Alfred hospital, continuing my work on a blood barcoding project which is progressing slowly but surely. In my downtime at night, I’ve been working on my Ray Tracer I blogged about previously, to improve its capabilities somewhat. I’ve managed to accomplish the following in the last week:

  • Fixed shadowing – was accidentally taking the compliment of the shadow factor
  • Fixed horrible hack for preventing secondary rays from returning a collision with the stating object – a better (and common) hack of moving the start point slightly in the ray’s direction fixes “invisible starting object” problems I was having when calculating shadows
  • Added Max U/V values to the TexImage image texture object, so that the texture image can be tiled any number of times across an object
  • Added correct Phong shading, moving the ambient light to a constant rather than a lighting object for speed, including correct diffusion and specular lighting
  • Added in translucency support for transparent or semi-transparent objects
  • Added in spot and flood lights in addition to the existing omni light lighting object
  • Added refractions and corrected reflection mixing routine to give better results

The results of which are much better than the previous code’s output (click to enlarge):

EDIT: Added photo of avoidance robot – thanks Jim!

 

Comments

No comments so far.

Leave a Reply

 
(will not be published)
 
 
Comment
 
 

 

Vital Stats

  • 35 Years Old
  • Australian
  • Lover of embedded systems
  • Firmware engineer
  • Self-Proclaimed Geek

Latest Blog Posts

RSS