Development19 Sep 2007 02:09 pm

Over the first 4 weeks of my senior semester, I have been working on a Rubix Cube application. It started out difficult, such as how we were going to represent the data structure. Once that was decided (using a lot of LINQ for helper functions), I started to focus on parts of the UI. During these parts of the UI, I ran into a couple of pitfalls while using DirectX that held me back.

Culling

So if you make the standard hand with your left hand, look at what plane you are defining your points. If you are defining your points on the XY plane, then notice where your index finger is pointing. If you are not looking at your cube from that direction, your item will not show up because of culling. You can turn this off, but remember you will get a performance hit. I preferred to keep it off because if my graphics card cannot handle ~100 triangles w/o culling, I might as well get another computer or do the computations by hand!

Z Buffering

Contrary to what I believed, DirectX does not enable Z buffering by default. From reading my book I was able to read how to turn it on, but essentially this caused whatever I was drawing last to draw over my other points – even if they were hidden due to their Z layer.

Those two problems really caused me to get a cube that looked crazy and with both combined debugging was impossible because there was no intuitive reason why I would see my faces sometimes and wouldn’t on other times.

This next week or so, we are going to be working on an installer for the application that will allow somebody to install and run the program. I’m not sure how many people will be happy to have to install DirectX 9 and .Net 3.5 to run our little 500kb or so Rubix Cube software, but hey, it was a fun project!

Trackback this Post | Feed on comments to this Post

Leave a Reply