What the code does
This demo loads in a mesh object from a .obj file and renders rotating it with perspective projection and lighting. The rendering is achieved using vertex buffers. This allows very efficient rendering of highly detailed meshes (though the mesh we render here is very simple). This technique is used in the code provided with our SolidSight Database. You will need to download the .obj file here, in addition to the code. Code and .obj file will need to be placed in the same location on your computer. You will also need to have installed a means of loading the .obj from Matlab (the .obj loading code provided in Psychtoolbox fails for many common .obj files). We suggest you used the readOBJ function from the excellent gptoolbox.