Here are some screenshots.
Top left screenshot shows a context menu that allows you to either edit or delete a selected notepad as well as creating one from scratch. This list uses a custom adapter.
Top right screenshot shows what a note contains as well as using a method that employs an async thread to fetch data via JSON from a Walmart or best buy database that fetches prices of your note.
Bottom left screenshot shows that my edit function works as it successfully updates a note in the database.
Probably the most important thing I will take away from this project is how to use a database properly how it does not reset the indexes once you delete a row and indexes start at 1, not 0.
The following Blugolds for completing this project.
1. Integrate a list view with a custom adapter/presentation into an app. 2. Use a local database to persist relational data. 5. Employ a web service in an app. The exchange format must be grammatically-defined: XML,JSON, or similar. HTML scraping doesn’t count. 6. Use threading to handle tasks off the UI thread.
]]>
My design is pretty intuitive. The large center panel is the drawing panel where I will be using the OpenGL ES plugin for drawing based on what button the user has pressed bellow and the Buttons bellow will be in a linear layout.
]]>
At first I tried to solve this by grabbing the closes vertex then taking the average of the neighbors which isn’t very accurate but it demonstrates the purpose of this assignment.
Then I attempted to change it to a spin off of linear Interpolation at a specific point. I measured the hypotenuse from the 4 corners and took a percentage of that to the height. But I was having problems when putting all the numbers together because they contained weighted averages.
My latest attempt was to throw out hypotenuse and just measure the containing area of each corner to the height which gave me a closer approximation. For instance if my (x,y) was (33.56, 20.45), then xDouble = .56 and yDouble = .45. Then depending which corner, decimal or 1-decimal, I would use these values and multiply them with a corner and then add the 4 corner contribution float values together for my new camera height.
Here are some examples along with some detail pictures.
2nd picture: middle row represents contributions from corners, topleft, topright, botleft, botright respectively. Last row represents cameras previous y position then moved to terrainY value.
Here is another picture.
Notice how every change in either x or z changes camera’s height which at some times is nice and fluid and other times it is very jagged. So I’m curious how you can make it near-perfect camera transitions.
Resources to accomplish this Feature: Chris and a couple peers, I also used the c++ book, that he gave out in 330, to double check if I was crazy or not, finding an error if outputs were the result of me accessing wrong locations or if it was an arithmetic error in my algorithm.
]]>However it crashed when I was fiddling with my project to implement feature 5, so the current working build is for this feature, working camera along x,y and z axis, here are some pictures.
The terrain has the size of 129, cap height of 50, and a decay factor of 0.50.
Problems I encountered to code this:
c++’s rand() is not the same as Java’s Math.rand() : rand() % 3 == Math.rand() * 2
Mistaking the command %d for printf’s for doubles, I was trying %d to print out a float, which was giving me garbage.
Just getting the translation down between ruby and c++ and the conversion of the imaginary 2-d grid to the actual float* array.
Lastly which is hinting on feature 5, learning how to access the terrain and comparing it to the cameras position, basically the problem is the constructor returning a pointer instead of the object, my Java mindset.
]]>Look at the other object, besides the terrain, whats the first thing that comes to your mind? If you thought of a TIE Fighter, give yourself a pat on the back. Anyways, I used the The Wind Waker lighting style and just applied it to all of the objects. So you might be asking yourself; this looks simple to do, what problems did you run into? Well since you asked, go grab some popcorn, then I’ll explain how I managed to hit pretty much every obstacle; this will be quite amusing. But before we get into that here is a slight distraction.
I think this name speaks for itself..
Anyways my stumbling blocks:
1) The most annoying error is accessing something that doesn’t exist which causes the program to exit. for instance program->(whatever). So after this feature I got pretty good with the debugger.
2) Learning the Multi-structured-transformer-jections and what effects it has on your viewing.
3) Random text being printed after the end ‘}’ in the shaders.
n) A stumbling block that you had no problem of solving.
n+1) Chris Johnson not available for questions after 5:00 pm, but I understand. Besides, half of my questions probably required a sigh before being answered. Props to Chris for not calling me an idiot or at least not directly.
Other sources that helped me: the class textbook, C++ for java programmers, (Alice in Wonderland spin off) for understanding pointers and such, and the opengl wiki that didn’t help much probably because I was asking the wrong questions.
So in conclusion, once I understood the set up of this whole thing: creating files with cmake, standard opengl libraries, debugger, uniforms, shaders, etc things began to fall into place.
]]>