Thursday, September 30, 2010

DONE! For Real!

Ok, so the problem I had with my Normalize was that I had the following code

void Matrix::normalize()
{
x = x / this->mag();
y = y / this->mag();
z = z / this->mag();
}

When I needed to do this

void Matrix::normalize()
{
float thisMag = this->mag();
x = x / thisMag;
y = y / thisMag;
z = z / thisMag;
}

The first code was caluclating this->mag() after the x value had changed, making it a different value all together.  Close, but not close enough.

Now for the written homework with Vector projections (yay /sarcasm).

DONE! ...well, pretty much

100 tests running, 2 failures.  Both are with Normalizing Vects in their [y].  Hopefully I'll be able to find out why that's happening.

For now, Written Part...

Vector Class finished! and some more Evil Matrices

Matrices are evil.  I've come to this fact.  Sure, they may be cool and all for translating, rotating, scaling, and skewing vectors and 3D objects in one go, but man, they are hella hard to write out.

So, I finished up the Vect_Matrix test instead.  I prepped the Matrix class for the other tests, but I'm surely stuck on MatrixSpecialType stuff.  My friends went to sleep, and my Physics Reference book says little about translating special matrix types over to C++.

Guess I'll be trying to finish up the Paper assignment that was difficult to find on the Physics Google Site.  Seriously not in the Assignments section like I thought it would be in, but hidden in the Week 3 lecture.  Fun times.

Can't wait for someone to wake up so I can finish this...

Matrix_Functions

Remember how I posted that the Matrix Multiplcation was probably the hardest, most annoying?  I take that back.  I now give that title to the Determinant.  That was probably the most annoying thing.  Now that I say this, the last few tests are going to be even more annoying.

Matrix_Unary and Matrix_Multiply

Possibly the easiest and least tedious of this assignment, Unary.  It was easy.

Possibly the hardest and most annoying part of this assignment, Multiply.  Matrix Multiplication on a 4x4 scale is SUPER time consuming and difficult.  I may have done a dirty way for doing operator*=, but at this point, I just want to NOT be doing this Matrix class anymore.

But I have no choice...

Matrix_AddSub and Matrix_Scale

Easy.  All of this is super easy because all I have to do is look back to my Vect class, and it's pretty much the same thing, just organized differently, and 4 times the size.

This is the most tedious thing I have ever done.

Matrix_Constructor and Matrix_Bracket

Very simple, as I already completed this in the Vect class, just need to re-implement into the Matrix class

...

I feel like I have become Satan's personal Data Entry Assistant, and he's using my love of math against me.

Two more groups down... I don't want to look at how many are left.  :'(

Vect_unary and Vect_Functions

Vect_unary + and - was seemingly simple.  Especially after going through the emails/discussion board.

Vect_Functions was a review of all the stuff I am learning in my GPH321 class, so I'm super glad to be taking that at the same time.  The only problem I have is that one of the checks didn't succeed.  More specifically that was check:

CHECK( eq(v1[y],0.534f,MATH_TOLERANCE) );

I stepped through it and it gave pretty accurate answer, but not accurate enough for the test, apparently.  Hopefully I'm right in my logic, but there's just something I'm missing to make it a teeny bit better.

For 39 tests in about 5 hours, I'm pretty proud of myself.  I imagine the disappointment that may be shrouded upon me for starting this late in the game, but I'm gonna make the best of it.

Now to open the second can of worms... Matricies.

Vect_Scale and Vect_Set

Vect_Scale was pretty easy aside from calling the operator* after a scaler instead of a vector.  Friend gave me a hand with that, hopefully I can figure it out exactly later.  Something to do with friend functions.

Vect_Set was super easy comparatively, as it seemed like it was just the constructors and copy constructor in a different form/suit.

Vect_Boolean - Done

I started this off with the first thing I thought of: if statements to check and see if all values were equal or zero.

After explaining how ugly this looked to my friend, he reminded me of the boolean operators &&, and that if one expression in the set of && wasn't true, it would return false.  After a quick do over, it looks a lot nicer and cleaner (and probably runs better) than what I had previous.

Next tests, ahoy.

Vect_AddSub - More bumps, more success

At first, I wanted to make the operators +, +=, -, -= global member functions, but I swear reading over something that the professor wrote that Global stuff was bad.  After giving up my Global conquest and continuing the assignment, I made them work as members of the Vect class.

I get two warnings however.  Hopefully this doesn't cause any troubles later.

In fear of the things yet to come, I've planned to submit via Perforce every time I complete a test file.  Hopefully that will somehow be helpful if things go to crappy creek.

Wednesday, September 29, 2010

Vect_Bracket Test - Full of bumps but success

Ok, at first I thought of this having something to do with overloading the operator=, but I learned from my friend that making a float& form of the first operator[]'s I had would let me edit whatever was listed in the address of said enum.

Next tests!

...

I will not sleep tonight.

Vector_Constuctors Test - GREAT SUCCESS

After I got through the first test, the rest of them seemed relatively easy.  In that I somehow passed both my copy constructor and deconstructor test without even making them.  That worried me a bit, but I declared and defined them none the less.

I was also explained that the deconstructor just needed to be declared since there was nothing dynamic being allocated.  Fun times.

Next up, Vect_Bracket tests...

First Test - GREAT SUCCESS

Thanks to some help from a friend, I was able to understand how to work with the enums and what the anonymous struct/union did.  Hopefully I can steamroll through this.  More updates to come.

Physics Hell

Just as I feared with an online class, I'm having difficulty staying focused.  I checked out everything and worked on it a bit today.  Going to be working on it constantly until it's finished.  No sleep for me, I guess.  >.<

Thursday, September 16, 2010

HW1 Done

Well, got HW1 done, albeit, a little late.  Took me a while to get Perforce up and running, and then getting my VS environment set up.  I don't have the book yet, so I hope there isn't anything drastic I'm missing out on.  Also wasn't sure how I was supposed to submit it, so I just added an entire project directory to the depot.  Hopefully that was the right thing to do.  >.>

The Fibonacci program was a little confusing to set up at first, but one I wrote it all out, I got the hang of what I code I needed to write.  Learned that I need to try to make this my primary class to focus (since I'm doing it online and all) and not push it to the back like I used to with other online courses.  I'll start by watching the next lecture right now.

My senior year is gonna be all fulla fun... ^_^''

-TZ

Wednesday, September 15, 2010

F1RST POST

After a weekend of moving the rest of my stuff into my new apartment, and clean slating my laptop (during which a block-wide power outage decided to occur), I'm finally getting caught up with work.

This blog will entail my grueling trials working on Game Physics Projects, wrestling with Perforce, and the (hopefully) ventured success therein.

Will update once I get everything else up and running.

-TZ