work stuff (involving matlab)
Sep. 7th, 2005 04:06 pmokay, so I was trying to render 3d geometry in matlab, and I noticed how slow matlab was when I tried to rotate the object with the mouse (move mouse to rotate, wait 5 secs, screen update). So, I got the idea of using glut (a cross-platform library that lets me put graphics in a window) in a c-mex function (c-mex functions are a way of running c code in matlab if its written in a certain way) to do the rendering instead .
I mesh together a simple glut program I wrote awhile back into a c-mex function and get it running. It runs fast like its supposed to. Just one problem: when I close the glut window, matlab closes as well. This causes a WTF moment since I don't want this behavior, and I don't know how to overwrite it (if its overwriteable).
Well a couple of google searches later to see if I can overwrite that behavior (didn't find anything), I decide to see if I can use opengl in matlab another way. Whats the first result of my google search...A link to technical support for matlab with details on how to force matlab to use opengl to render. Now the object I was rendering earlier rotates smoothly without any delay from the mousemove to rotate and the actual rotation.
In other news, someone brought cake to work. Yea cake.
I mesh together a simple glut program I wrote awhile back into a c-mex function and get it running. It runs fast like its supposed to. Just one problem: when I close the glut window, matlab closes as well. This causes a WTF moment since I don't want this behavior, and I don't know how to overwrite it (if its overwriteable).
Well a couple of google searches later to see if I can overwrite that behavior (didn't find anything), I decide to see if I can use opengl in matlab another way. Whats the first result of my google search...A link to technical support for matlab with details on how to force matlab to use opengl to render. Now the object I was rendering earlier rotates smoothly without any delay from the mousemove to rotate and the actual rotation.
In other news, someone brought cake to work. Yea cake.