Monday, April 18, 2011

Not quite a skeleton

But something displays. It has something to do with the order with which Processing processes the translations/rotations, and whatnot. The AMC parser works fine at the moment, but I think I just need to debug the recursive display() function I wrote. The challenge is trying to make sure all the functions related to drawing/translating/rotating execute in the proper order and in the correct coordinate system relative to each other, which is getting messed up somewhere currently.

Current train of thought:

The idea is that you want to keep drawing a chain of joints within the same coordinate system as the stem of the chain. Therefore, you need to push/pop matrices so that once you run out of joints in that lineage, you go back to the common ancestor and pop matrix so you start drawing again from that coordinate system. So if you start with the root, you want the left arm to get drawn in succession, but then you can't exactly start drawing the right arm without reverting back to the coordinate system of the root. Thus you need to push matrix right after you draw the root and then pop it when you're about to start drawing the right arm. There's a code sample on page 112 of the book Getting Started With Processing (Casey Reas & Ben Fry) that makes a lot of sense in terms of how the transformation hierarchy works. I think I'm just hitting a block in articulating my thoughts but it makes sense to me.


Will debug today.

Also, I wrote a Frame class that holds a skeleton and a frame ID. I'm trying to make it so that the parseAMC() function creates a new Frame object for ever frame it reads, but right now, it seems as though the program overwrites the same Frame, even though I used a similar code structure for creating new Bones in the parseASF() function and that works fine. This would be where a better IDE (allowing for better debugging functionality) is helpful. That being said, debugging has been extremely slow with the Processing IDE so far. I didn't think it would be as slow as it has been.

I've also been sick for the past week and a half. It's been such that I've had a recurring headache this entire time. Not the worst, but certainly annoying when you have to stare at a computer screen all day. :(

Saturday, April 9, 2011

OMG I HAVE SPHERES

Well, kind of sort of. Last night, I realized that ProcessingJS actually doesn't support 3D yet, which is a major pain in the ass. I'm going to code everything in Processing for now, and when ProcessingJS does support everything 3D (which should be soon...), it's a simple task to port over the code to ProcessingJS. Like, copy-and-paste simple.

The smaller sphere is supposed to be the root (I just set radius = 10 for now) with a translation on it, but I'm going to do some debugging now and fleshing out the AMC code. At least I have something.

Thursday, April 7, 2011

Beta Review

So on Tuesday, I had my beta review with Norm, Joe, and David. Essentially, for the past week, I had been working on parsing the asf/amc files using Processing. However, as I described in the meeting, ProcessingJS unfortunately does not have a BufferedReader implemented, meaning that I had to treat the entire file as an array where each line in the file comprises an entry in the array. Barf.

So I think I'm pretty much fine with regards to the asf/bone/skeleton structure, but the amc file was a little confusing because I wasn't sure what the best way to interpret that was. Thankfully Joe cleared it up, and I shall get to working on that, including displaying just one joint/root and hardcoding translations/rotations to make sure the system works.

After that, I can replicate the skeleton. Whee.

Friday, April 1, 2011

Got a rough UI up...

So I got a rough UI for the search results page up. It pretty much adheres to my sketch a few posts back, but now it's actually marked up and stuff in an adaptable way, I hope! The page is here (currently has dummy content and doesn't do anything, but for the purposes of the simple user study, it'll do), and a screenshot of it is below:

After playing around some more with webGL, Lu alerted me to the existence of ProcessingJS, which enables you to use Processing to make visualizations for the web without using any plug-ins. Hooray! With ProcessingJS, I can either code in Java or Javascript, and it'll work on a webpage. After testing out a few examples, I've determined that this more what I want to work with, so I got the OK from Joe to switch over to Processing.

Before the beta review, I'm going to try to get a skeleton up and running.

Thursday, March 24, 2011

Self-Evaluation

So this past week I tried working on getting a skeleton to display using webGL. Unfortunately, I wasn't entirely successful. I spent most of the time looking at sample webGL code, looking at the asf/amc parser code Joe sent, and figuring out how I would go about even doing something like this. Lu clued me into something called o3d that builds on webGL, allowing developers to create interactive 3D applications. Looks like something I can use, so I was trying to get a sample o3d program to display. Due to stupid mistakes on my part, it took a lot longer than it should. But you can see it here, in case you're wondering.

I met with David today to go over the sketches I had done. He suggested that I don't abstract the data as much, which is really valuable and helpful advice. I agree with him, as some of them (particularly this one and this one) are hard to read and interpret at first glance. They involve kind of a significant learning curve, which I don't think is the best thing to display in search results. I'm not ruling them out though – they may be more appropriate for an advanced view.

Self-evaluation:
Honestly, I have a lot left to do. By the beta review, I'd like to have a skeleton up and running. After that, I need to mock up a visualization and do a quick and small user study before the demo day. For that study, the "moviz" webpage will be hard coded and won't actually interact with any databases. This page shouldn't be hard to do.

I feel like I could be doing more, and I don't know if it's because I'm a relatively slow coder/slow to pick up new programming languages or because it's second semester senior year and I'm mentally exhausted, but I'm not happy with the schedule I'm on/my progress so far. I expected to code, but I didn't expect to do this much with gl, and I wasn't entirely prepared for that given the last time I touched openGL was a year and a half ago. I went into this project hoping to work with Processing, but things changed and I need to adapt to that. Hopefully I'll get everything I want done in time.

Also, my computer severely lags whenever I have a webGL page running. It's really annoying.

Thursday, March 17, 2011

Playing Around with WebGL

This week, I read up on WebGL and tried to play around with it. Originally, I was planning on doing a "Hello World" example with some squares, but then I realized that I actually don't know how to render text in the window frame. Don't remember doing it in 277 or 460. :( Anyhow, a quick Google search didn't help much, because most results ended up involving textures (is there an easier way to render text in the actual drawing window?).

I then realized that it had been a year and a half since I had done anything hands-on with openGL, and thus needed a refresher. What I ended up doing was following a tutorial on Learning WebGL and getting a blue square to display. Then I got two blue squares to display. This took a lot longer than expected because I wanted to type up the sample code myself and figure out how it works. I think I got it for the most part... Check out the super exciting screenshot below.
webGL is based on Javascript, for the most part (except for the shaders), so the syntax is different from what I'm used to programming graphics in. I like that it's a web-based format though, and I can also use HTML5. 

Plans for next week:
  • get text to display
  • get a skeleton to display (this involves being familiar with reading/parsing files in webGL)

Saturday, March 5, 2011

I have a TEDache

In the best way possible, of course.

I realize I'm really late in posting this, but this past week, I've had the immense pleasure and fortunate opportunity to attend TEDActive, the simulcast of TED 2011 in Palm Springs, CA. While there, I barely had time to pee, let alone write a blog post and do senior project work. The experience was incredible, and I would gladly do it all over again. I met some amazing people, all of whom had accomplished extraordinary things. I felt so out of place at first, but the beauty of this conference lies in the people and that they all believed I had something valuable to contribute. I'm still trying to figure out what I contributed, but it's nice to know they found value in talking to me. I face a while of battling post-TED depression, and I fully intend on trying my best to become a TEDster and uphold the brand through future TEDx events I plan to organize. I apologize terribly to Joe, Norm, David, and Amy (and anyone else who may care...) for my lack of posting. I'll make up for it as soon as I can.

Meanwhile, I'm sitting in the Palm Springs airport, writing this post on my iPhone because the wifi doesn't work on my Mac :( I forgot how tedious it can be to write a massive amount of text from the phone.

To describe the feedback I got from my alpha review, here is a bulleted list for your reading convenience:
- presentation: too many slides! Go slower next time.
- User study: is it even necessary? The CMU example is terrible.
- more sketches allowing for comparison
- need to start coding! WebGL is good
- try sketches that show figure of person - allows for blending purposes