Week 1: June 11-15

The week got off to a slow start since Professor Interrante and I were unable to connect on Monday morning and thus were not able to discuss the specifics of the project so I could get started. One of the graduate students, though, helped me get acquainted with the lab and get an account set up.

I now know that I will be working with Haleh, a graduate student at U of Minn. The project that she is working on has been on going for quite a while. The project is titled "Investingating the Effect of Texture Orientation on the Perception of 3D Shape".

In preparation of me actually starting to help on the project, this week I spent some time looking through the existing body of code that already is in use for the project to better understand what is going on. I also spend a great deal of time learning OpenGL, a graphics library for C.

Here a few of the things I created in OpenGL -- click for a larger image.


Return to my journal page
Return to Main Page





Week 2: June 18-22

This week Haleh has been gone which means I was working on the project by myself. Luckily I was able to meet with Professor Vicki on Tuesday, so after I finished up on OpenGL on Monday, I had new tasks to do.

The part of the project I am currently trying to tackle is creating a program that can generate a "family" of surfaces that are similar but differ by a small amount. The way Vicki suggested I do this was to create a surface or object that is based on a b-spline and then change one or several of the control points of the b-spline to create a family of surfaces. I first learned how to generate splines using OpenGL. I then created a program that would change a control point and show the surface changing. I then mapped a texture onto the b-spline (since eventually the surface needs to be textured to be a part of the study). Vicki also gave me a program that was done by someone else that created a 1D spline and then rotated it to create an object. I used some of that code to allow me to improve my program. It allowed me to "zoom" in on the surface, rotate it, and translate, with motions by the mouse.

Here are some "snap shots" of what the splines the program creates looks like:

On a fun note: this week I was able to eat with Jessamy Ofcarcik, another participant in DMP that is working downstairs in Robotics and Artificial Intelligence. We had a good talk. I also am looking forward to going home to Iowa this weekend. Jason's sister is having a bridal shower (she's getting married in July). It also will be nice to see everyone again. I've been enjoying the weekly lunch outings that the graphics lab has. It has been a good way for me to get to know more of the graduate students.


Return to my journal page
Return to Main Page




Week 3: June 25-29

Haleh is back this week so we spent some time discussing what has been accomplished and what we need to do yet. She is working on altering some existing code to work with Mathematica and several other programs at once.

I spent the first half of Monday banging my head against the wall... I was trying to figure out a way to access the data OpenGL generated (i.e. locations of vertices on the surface) when creating the surface. The book had seemingly useful example, but the header files that I had been using did not support the constants and modes I needed. So after much searching and asking many questions, I finally found the newer versions of the include files and can now save to file all the vertices that are generated to define the surface. I am still working on file format. Altering the file format not only meant controlling how data was written to file, it also included a perl script to change the data that OpenGL grouped in "triangle fans" and "quad strips" into only triangles but retaining information on their connectivity. I have also been working on trying to create a more user friendly way to alter several control points at once.

All was going well this week until I tried to "expand" my spline program. My goal was to add control points to the spline so more parts of the surface could be manipulated and create a more interesting surface. Well, it did not go as planned. I realized after a discussion with Haleh that I really needed uniform splines and we thought the ones I had been generating were nonuniform. So we set out to change my program to uniform splines. Every source we read about OpenGL and its spline interface said about the same thing and nothing was working. I ended up quite confused and have had to re-learn splines again. We now need to decide if the mathematical headache that could come in the future when dealing with surface formulas of non-uniform splines would be worth the ease of manipulating surface. I'm pretty confused. It seems that the surfaces from the non-uniform splines look more interesting than the uniform ones and changing their control points seem to have a more expected result. Hmmmmmmmmmmmmmmmm.

(Now it is Friday): Well, all the confusion Wednesday and Thursday paid off I guess. We now have large uniform splines -- 64 control points. The surfaces are much more interesting then when we had only 16 control points. I also know that the file format I've been working on is correct. We successfully passed output of my surface generation program to a "Gabe's program" which takes vertices and connectivity relationship as input, creates the surface and does some calculations on it. It is exciting.

Click on the pic below to see a larger image of my uniform spline!

On a fun note: (I decided this section should occur in each of my journal entries) This week I ate lunch with Sarah and Jessamy ( the dmp girls working downstairs) twice. It is nice to hang out with them. On Wednesday we ate with some people from an Engineering/CS program for undergraduate students going on at the U.

A group from the graphics lab went out to eat again this week. I have been getting to know Haleh a lot better since we are working more together now then before.

We had an interesting occurance in the lab this week... Thur. afternoon, all of a sudden everyone's computers went off... the computers lost power yet the lights were still on... It ends up we blew a circuit in a surge protector. For some reason all the computers were all eventually connected to that one surge protector. Its all fixed now so it won't happen again... Exciting lab life.

Oh, yeah.. eventually I plan to get some pictures up of some people from the lab but it might be a while.

Return to my journal page
Return to Main Page




Week 4: July 2-6

This week has been considerably slower than the previous ones. I finished "tweeking" my spline program so that you can alter any of the 64 control points without recompiling, improved comments and cleaned up the code. I even added an option to change all the control points by adding the Sin of the z coordinate of the point to the z coordinate. (This warps the spline more "uniformly" and we know the difference between the splines each time we do this).

Otherwise, Haleh and I have gotten quite stuck on one aspect of the project. There is a pre-existing program that when given points on the surface and the u and v coordinates for the point, it finds principle direction for the point which is used by another program to "grow" a texture on the surface. To get the program to do these calculations, you need to set up a Mathematica notebook that contains the surface equations and finds the u and v for a point. Because we are using splines, the surface formula is quite complicated and we are having problems setting the notebook up to solve for the u and v coordinates. The surface equation is based on a series of nested if statements and we are beginning to wonder if Mathematica can solve the equation.

Haleh decided that we were completely stuck and we needed to try something completely different. She wants to try to create the splines without OpenGL's interface hoping that she will be able to control the values of the u and v parametric coordinates. What this means is that the spline program I've spent the last two weeks writing and perfecting is no longer useful. It is extremely frustrating to realize that something I put so much time into no longer has a purpose. It also means I have nothing to do now since Haleh wants to do the spline generation. So, I get to "try" to rewrite the huge interface files into OpenGL from X. I basically have to start from scratch and try to mirror the goals of the previous interface. And since I know nothing about X, it is going extremely frustrating. Oh well, so goes the world of research I guess.

On a fun note:



Return to my journal page
Return to Main Page




Week 5: July 9-13

Monday Haleh suggested I learn about animations instead of trying to change the files to OpenGL. So, I visited the graphics class website from this fall and did some digging and was eventually able to make an animation of my spline program. It was fun.
Click here to see my results.

Monday afternoon I was able to talk with Vicki. She suggested I start on another part of the project-- Generating textures in the principle direction. There is already a program that does this by rotating the texture to follow the principle direction, but what Vicki suggested I try is to use Line Integral Convolution (LIC) to create the texture on a 3D surface. This of course means I need to learn about LIC first. There is some existing code I can look at, but I have mostly been reading papers. Below is links to some of the papers and some other interesting sites about LIC.


On a fun note:
Return to my journal page
Return to Main Page



Week 6: July 16-20

After spending last week getting a feel for LIC, Monday I met with Vicki to ask her some questions. In the process of our discussion, she decided that LIC for 3D surfaces was too large of a project to complete in the time I have left this summer. So, she scaled down my project considerably. Now, my goal is to read in files containing vertices, faces and u and v and draw and texture the triangles. The idea is that soon someone will take the part that I write and add the LIC part of the program to it since texturing triangles is part of 3D surface LIC.

I also have been working with Haleh's spline generation program. We found out that Gabe's program, the one that aligns textures using the principle direction can not take a surface as input. So I added a bottom and sides to Haleh's spline. It took a while to be able to save the added faces and vertices correctly. Especially the faces on the sides since they depended on vertices only along the edges of the shape and were not saved in that order. I also added parts of my spline program to hers, like the ability to change any of the control points in the z or y direction.

By the end of the week I got fairly far on my texturing of triangles project. I can now read in a file of faces and vertices. I store the information as vertices, triangles and edges. I also have the texturing part pretty much working. Calculating the texture coordinates and finding a good mapping between texture and world coordinates took a while. I still have a few artifacts -- some triangles are not quite textured correctly and look a little distorted. But I certainly have less distorted triangles than what I started out with.
Click here to see my spline with textured triangles...

On a fun note:

Return to my journal page
Return to Main Page



Week 7: July 23-27

Wow it is week seven already. This summer has sure flown by!

Well, after several frustrating days, I finally found the bug in my texturing program that was distorting the texture on the triangles. I was beginning to wonder if I would ever find it, but with Haleh's help my erroneous assumption was uncovered. Once the program worked for our 3D splines, I tried a few other models to make sure the bugs were gone for good. My favorite was the cow... the now black and white checkered cow. ( yes I am from Iowa! )

Haleh figured out the problem we were having with passing our vertex and face output to Gabe's program. Our original hypothesis, that we needed a closed surface, was incorrect. Instead, our problem was that we were writing the file incorrectly. We had some vertices in the file multiple times which made the file no longer contain valid connectivity information. Haleh fixed the problem and now things are working much better.

Once I got my texture program working, I met with Vicki. Now she wants me to try to do LIC for 3D surfaces again. Well, I only have 3 1/2 weeks left, so we'll see how far I get. Right now I am working on smaller functions like calculating the normals of triangles and a point-in-triangle function. I have also been figuring out how to create ppm files. I also have been setting up my program to be able to create a ppm file of texture for each triangle and then texturing each triangle with its appropriate texture. There are a lot of details to work through, but progress is happening, slowly. I have been having problems defining the relationships between world/object coordinates and length and texture coordinates and length. I went to talk to Vicki about this and thought I understood it, only to find out the reason my textures were looking so terrible on the triangles is b/c texture coordinates must be in the range (0-1), so the mapping and relationships we defined don't always work.

On a fun note:

Return to my journal page
Return to Main Page



Week 8: July 30-Aug 3

Well, I've been working alot on a few functions trying to make sure they work.Pretty soon I will have most of the little things done and will have to tackle all the math and confusing details of LIC... I am a little worried.

I figured out my problem with texture coordinates. I found out how to use the texture matrix in OpenGL which allows you to use texture coordinates that are not between 0 and 1. I don't know if I would have ever figured it out if I hadn't posted my question on the OpenGL forum.

After talking with Vicki on Wednesday, I was able to figure out how to create a texture by taking "steps" across the triangle the size of pixels. So now I can create textures that are square that have the triangle in them (ie a black texture with a gray triangle, the same proportions as the triangle that the texture is getting created for). I used the texture mapping coordinates as well as the vertex coordinates to create a conversion from 3D coordinates to 2D texture coordinates. This allowed me to "step" across the 3D triangles to color the pixels on the 2D texture. After accomplishing this, I ran into another bug. There's something wrong with mapping of my texture... its not quite working right.

Vicki also better explained barycentric interpolation so that I was able to create a function which does this. I will need it when I start the LIC full force. Once I get my texture bug figured out, that is where I am going next.

At the end of the day on Thursday, Haleh helped me find my texturing bug. It ended up there was nothing at all wrong with my texture coordinates which was a good thing. Instead, I was reading and writng the texture files from top to bottom but when I read in the texture file and passed the pointer to the array to OpenGL, it was assuming I had read/written it from bottom to top. So that is why it wasn't texturing the way I thought it should. I simply changed how I wrote the files and it works much better.

Friday I finished up cleaning up my program after fixing the bug. Then I started another function I will need for LIC. What I need to be able to do is when I find out the streamline has left the current triangle, find the triangle the stream line is in now. This will be done using the edges and triangles relationships stored as well as my functions that project a point into the plane of a triangle and check if a point is in a triangle.

Friday was Haleh's last day. She is taking the rest of the month off to study for her Phd. entrance exam. Hopefully I will be able to get this LIC program done so she can use it in the fall since it supposedly will create textures more suitable to the study. It will be strange to not have her around my last two weeks here.

On a fun note:



Return to my journal page
Return to Main Page



Week 9: Aug 6-10

This week got off to a slow start. I spent most of Monday and Tuesday working on my function to find the triangle the streamline for LIC traveled into. I did some debugging of a few problems, as well. I also was trying to figure out a few more of the details of LIC. I'm having problems deciphering how to apply the pseudocode and code for 2D LIC that I have to the 3D LIC surface made up of triangles. The paper on 3D surface LIC does not go into detail on the differences between the 2D and 3D procedures for LIC. Vicki has been very busy this week since SIGGRAPH is next week, so I haven't been able to meet with her to discuss my questions.

I was finally able to talk to Vicki on Wednesday. She is giving a talk at SIGGRAPH about Non-Photorealistic Rendering so she has been doing alot of research for that lately. Vicki cleared up alot of my confusions about LIC, especially which parts in the 2D example were only done for efficiency reasons so I wouldn't need to worry about in 3D since the textures we were creating were so small. It ends up, I had a pretty good handle of what was going on I just didn't realize it... but there is still alot to do.

After running a test on a larger model, I realized there were some cases when the interpolated vector gets too small and it results in an infinite loop. I also realized that my function to find the triangle the streamline traveled into isn't working well enough. Over half the times it is called it can't figure out where the streamline went. It is ok for this to happen sometimes since the stramline can travel off the outer edges of the surface, but half seems way too high. I might have to figure out another way to find the "current" triangle.

I spent Thursday and Friday chasing down some major bugs. I found out the reason my LIC textures didn't look very good at all was because the variable I was accumulating the values along the streamline was not large enough. After fixing that my textures started to look much better. I also was able to greatly improve my function to find the triangle the streamline traveled into. Most of it was just simple code improvement and debugging. Now the function can't find the correct triangle only 1 to 2 percent of the time which is much better. I also made some improvements to get rid of inconsistencies and lines that were occuring along the edge of the triangles. It has been a pretty productive few days.

The output lately isn't perfect and there are some more things I need to fix, but to finally be able to tell there is a LIC texture on the surface is great.
Click
here to see one of my output images.


On a fun note:

Return to my journal page
Return to Main Page


Week 10: Aug 20-24


Wow my last week... after having a week off.

Monday it took me a while to get back in the swing of things after being gone. I did make a better example of an LIC surface. (Click here to see.) There are more problems on the surface... strange gray sections appear. I need to figure out where they are coming from and then I'll be close. There is plenty of polishing and fixing to do to keep me busy this week.

Tuesday I was able to get rid of the gray patches and make a few other improvements by changing a few constants. (Click here to see.) My program is very slow though since it is making so many textures that it takes a while to see if your changes helped or not. I have used some smaller models, but if they are too simple some of the problems do not occur on them. I also added an option to my program to just display the image assuming that the textures have already been made during a previous run of the program.

On Wednesday I worked on trying to get rid of "grains" of noise that was appearing in my textures after I had fixed some other errors. It took a while to find where it was coming from. I talked to Vicki about it in the afternoon. She suggested that it might be occuring at the triangle vertices. After some testing Wednesday and Thursday I concluded that she was right. I originally tried to artificially extend the triangle texture to prevent the noise that filled the rest of the texture from getting included in the texturing. I couldn't seem to get that to work well enough so I decided instead of having "noise" fill the unused part of the texture, I just gave it a gray value. This not only cut down on function calls but it also eliminated almost all of the "grains".

On Thursday and Friday I attempted to tackle the "seams" problem. Vicki suggested that what was probably happening was that one of the three direction vectors for the triangles was pointed 180 degrees different than the other two directions. So I did a check in my program and flipped direction vectors that were "bad matches" with their neighbors. This made the texture on the surface look better. I spent most of the rest of my time commenting code and making the project understandable to the next user. There are still a few minor problems with the project, but it feels done enough that I feel alright leaving it as it is.

To see my final results, click here

To read my final summary of my experience, click here

On a fun note


Return to my journal page
Return to Main Page