Friday, February 22, 2013

Graphics Assignment 6

Exporting from Maya was really amazing. I wanted to export some fantastic model. But lack of knowledge in Maya held me back for a lot of time. The Maya Exporter did not work for some meshes. Finally I exported a Spiderman model which looked amazing :D.

After that I moved to converting the file into binary. I was struggling in understanding the concepts for binary file. Sherly and John-Paul helped me to understand it. So I was pretty happy that I will be able to complete the next part quickly. But then a weird error troubled me a lot. When I was writing the file in binary, the compiler gave an Debug Error which said Invalid Allocation Size. Moreover, I could not debug the MeshBuilder application. Debug window did not open and Windows asked whether I want to report the problem. So after trying to find out the problem for a long time, I gave up on that.

Then I added a few more Meshes from Maya and was trying to recompile after deleting the temp folders. A new problem arised. The Mesh builder did not compile. I did not make any change in the Mesh Builder and it started giving me an linker error. I restarted the computer and it started working.



Updated on 1st March:

Since I could not complete the assignment on time, I did not submit the completed assignment. After that I was trying to figure out why my assignment did not work and I could not go ahead. AB, apparently found that the reason for that was my anti-virus program. My anti-virus program blocked some of the .dll files and hence the MeshBuilder did not compile properly. 

After that problem was solved, I pretty much knew what I wanted to do. I created my binary files, read the data from the binary files and then drew the Meshes. Then I moved to the 2nd part of the assignment which was sorting the Meshes in such a way that all the way that all the entities having the same effect are grouped together. Moreover, all the entities having the same material should be grouped together. This was done to minimize the changes between the register data of the GPU (I guess).

After this was done, I was clear for doing the next assignment :D.

Friday, February 15, 2013

Graphics Assignment 5

After I was done with assignment 4, assignment 5 was pretty easy

For making the specular light work, we calculated the dot product between ViewVector and the Normal of the surface. This was multiplied with the dot product of LightDirection and the normal because we did not want light on the opposite side of the Mesh.

Finally exponent was used to define the texture of the mesh.

Download Code


Graphics Assignment 4

Phew......This assignment was too big for me. This assignment needed a good structure.

In my structure, scene has information about the Light, Camera and the Entities.

Entities had information about Meshes and Materials that the mesh will use.

Materials had texture information and effects which will be applied to the Mesh.

So basically a mesh got data from 2 sides. 1. Scene and 2. Materials.

After a mesh had all the information it needed, during the Mesh Update, it drew on the screen. There were more than one entities on the scene, each with a different material and different effect.

I got stuck with a trivial thing for very long time. I could not see anything on the screen. Then Sagar Mistry was tweaking through my PIX and said there could be something wrong with the transforms. So then I checked my files and CameraPosition was {x,y,z} = {0,-10,0} instead of {x,y,z} = {0,0,-10}.

Controls

Moving the camera

W A S D

Moving the Light

T F G H

Moving the objects or meshes

Arrow Keys

Download Code



Thursday, January 31, 2013

Graphics Assignment 3

After creating a 3D Cube and coloring it, it's now time for texturing it and adding some light to the scene.

In this assignment, I figured out including the light pretty easily. I was very clear about the concepts. SO it was just about passing some extra variables to the shaders and doing the Math.

I have a cLight class. It's position can be changed at run-time using 'T'(up), 'G'(down), 'F'(left) and 'H'(right).

I struggled a bit with the texture. I added the file to the textures folder. But for some reason my texture did not load. Then I found out the reason. I was loading the texture during the initialization process. It should have been loaded during the loading of the scene. After I changed it, texture should up.

Screenshot with texture and light
TextureData in Pix

 I used the "fake" normals for processing the light. I used the mesh-coordinates as normals for the cube. After completing the assignment with these normals, I tried increasing the number of vertices and changed the data for the vertices but it messed up the cube completely. I will try to use the real normals but for now here's the assignment 3 with "fake" normals: Download Code

Friday, January 25, 2013

Assignment 2 Graphics Class

Introduction to 3D

Phew!! This was a challenging assignment for me. I understood all the concepts. But the biggest challenge was to convert those concepts into code. I referred and got some help figuring out the code part from Jason Thummel's Code.

For Moving the Camera:

I created a cCamera Class. cCamera Class create the World To View Transformation Matrix.

Controls for moving the camera:

W - Up

S - Down

A - Left

D - Right

Controls for moving the Cube

Up Arrow - Up

Down Arrow - Down

Left Arrow - Left

Right Arrow - Right

For the World To View Transformation, I used the LookAt function.

cMesh Class created the Model To View Transformation Matrix

I had problems figuring out how to create the View To Projection Transformation Matrix.

Following links helped me understand it.






Here's the link for my code:Download Code

Thursday, January 24, 2013

Decision Time


My pitch started with a thought that I don't care if the game idea is bad or not but I want to pitch and it ended with I WANT MY GAME IDEA TO BE SELECTED :P. I really thought I don't care whether the game gets selected or not but I thought so much about the game in the 2 days before the decision was going to come out that I got attached to it. After the pitch I thought of so many things that could be done with this idea.

So, it was decision time. Roger, Bob, Craig and Mark (The Selection Panel :P) came to the lab and they said that they would give comments about each of the pitches. They said that my game idea was not new and there are a lot of games that have used shadows for something. Shadows was compared with Curse Of Shadows and they were of the opinion that another game about shadows won't be cool enough. (Shattering sound :P). I expected a lot good from this game idea and I felt that "Ahhh. I am sure it's not getting selected. So just move on and start thinking about other games."

After their comments about all the games, I was just waiting to hear were games were actually selected. And then comes the decision. They don't select the games this time...we do...!!! There should be at least 5 people on one team. As soon as they said this I knew that this is not going to go well. There were 18 pitches and 26 people in the Cohort. So people will have to give up their ideas and join other games. I knew it was going to be a mess.

The mess started right then. People moving it and out of groups. I believed in my idea and I thought I would convince others to make Shadows. But I got no chance to explain how my idea was different or how the team could make it different. 

I chose to be in the race then gave up later in the day. Thought over it again and thought of coming back into the race and finally I gave up again. I thought this was a good thought on their side to let us choose the games we want to work on. But the best thing that could have made the process a lot easier would be shortlisting the games. Shortlisting would have made easier for people to leave their game ideas and join other ideas. If I knew that Shadows does not have any chance, I would have readily and easily joined Cellblock the very first minute after the decision was told to us.

Loving the game that you are working on is really important. Giving that chance was completely correct. But the mess in the process could have been avoided. I thank Roger, Bob, Craig and Mark for giving us the opportunity to work on the game I like.

I love the idea of CELLBLOCK and I am all set to create an awesome game now.

Pitching Game Ideas for Thesis Game

Yeah! It's a new semester and everyone was excited about what is going to happen this time. We knew that we were going to start working on our thesis games. We had the opportunity to pitch our own games ideas. It was not a necessity but being involved in some pitch in some way was.

I had a set of mechanics that I thought were interesting but I was not able to build a game around it. It's not that I did not try. I was trying to build a game around these mechanics and write a thesis paper on it in the last semester's game design class but I landed up pitching an idea which I did not quiet like. So I had to be involved in some game pitch.

So.....My To Do List said....FIND A GAME THAT YOU LIKE AND BE A PART OF IT. So I asked Kiran if I could help him with his idea of augmented reality game idea and he was cool with it. Somewhere I knew that I wanted to pitch a game. But I could not because for pitching a game, you need a game idea :P and I did not have one.

That night, AB (Aaradhya), was working on his game pitch (Footprints) and I was sitting with him. He was so excited about pitching a game. He was literally saying that it doesn't matter to him whether his idea is good or not, but he wanted to pitch and I was like, "Yes. Why can't I just go out there and pitch a game? It does not matter whether it is a good game idea or not." So yes, AB was an source of inspiration for my pitch.

Me and AB looked through some videos of IGF games and we were really awed. The game ideas that really made me go crazy were 'Perspective', 'The Bridge' and 'One and One Story'. I really loved those game ideas and I wanted to come up with something different. So I started thinking about the mechanics I had and mould it into a game. One of the mechanics, was to duplicate things or in other words, change one object into other. This dragged me to SHADOWS.

I don't know how this happened. An idea just came into my mind at 2 am in the morning and I was like, "Yes. This is what I want. And this is not just some game idea. It is AWESOME!!!". So I started preparations for my pitch. There was no research behind the shadows games. I had no clue if there exists some games which use this. (I knew Curse of Shadows but it didn't come in my mind because I still think it is a different game). I did not research about anything whatsoever. Rather I did not have time to do that.

Me...Pitching Shadow
Next morning I was pumped up for my pitch. Before this idea came into my mind, I really believed that I was not capable of coming up with a good ideas. I had no confidence that I could come up with a good game idea. (This opinion of mine is now changed. Surely.) Now that I believed in my idea, I wanted to give a best shot. The pitch really went well and people liked it ( I guess :P). So I was really happy.

Concept Art of Shadow