Tuesday, May 25, 2010

Special Post #33: OpenGL Model Viewer

My last coursework from second year was to design a 3D model viewer using OpenGL and GLUT. I know that probably doesn’t make sense to any of you, but maybe if you tried it out you’d get the idea.

The final program lets you place objects in 3D space and can be downloaded for your enjoyment by clicking on the button below.

A few things you should try:

  1. Right click to get the menu where you can select shapes, colours, etc
  2. Press and hold your scroll wheel (middle click) to rotate the world, or do this while placing an object to rotate the object
  3. Use x, y, z, X, Y and Z to do rotate
  4. use ‘r’ and ‘f’ to size objects and pseudo-zoom
  5. use ‘=’ to scroll through objects when in selection mode
  6. use ‘0’ to delete the selected object
  7. use w, a, s, d to move up, left, down and right
  8. use ‘1’ at any point to change your view back to the origin and reset the lighting model
  9. try loading the bunny.tri file, it takes about 17 seconds to load on my machine, so be patient!
  10. Move the light source around from the menu
  11. Select objects in ‘selection mode’ and scroll through them to get the right one
  12. Change the render mode to points, lines or phong shading

Good luck! And have fun! Let me know if you have any problems, I quite like the idea of tweaking this over time, although it’s got a long way to go in reality…

4 comments:

Ankur Banerjee said...

Up up down down left right left right B A does nothing. :(

Can spend hours rotating the Stanford Bunny around though.

Will Johnson said...

Hehe, opened up Bunny.tri on the uni computers... took about 10 seconds to load then immediately crashed.

Yaaaaaaay

Ankur Banerjee said...

I'm surprised Charles that you didn't know about the Konami code. Discover the awesomeness here - http://en.wikipedia.org/wiki/List_of_Konami_code_websites

charles said...

wow. that is crazy. I'll have to put that in version 1.1 for sure :P