Friday, October 27, 2006

The varied mysteries of the inner mouth society revealed at last!

Nanowrimo's going to be starting up again soon. If you fancy trying to write a short novel in a month then register! I did it last year, and though I've never gone back to the awful sprawling draft I gave birth too I'm quite happy to create a new one. Last time it was some generic, steampunkish fantasy, this time it's a modern time travelling thriller (or similar). Novel writing begins on the 1st of November!

I just added an Fps counter to my coursework, I didn't need this but it's there anyway. I also have a rough plan (half remembered UML ahoy!) - if this plan levels up from "rough" to "okay", I'll be very happy. I'm going to leave it overnight without looking at it and hope it'll have grown by the morning.

Programming C++ after C#, is like programming in broken glass.

Wednesday, October 25, 2006

Burning houses in stinking fog

So I've just managed to get cxxtest working in visual studio.
As I'm still not at home in C++ this took much longer than it should. I had no idea where it wanted the PERL environmental variable defining. (I defined it for the system) but it turned out it wanted it defining in the makefile.

Which ended up looking like this


PERL = c:\Perl\bin\Perl.exe

# Where to look for the tests
TESTS = H:\CW1\Parser\Parser\*.h

# Where the CxxTest distribution is unpacked
CXXTESTDIR = H:\cxxtest


Done a bit of a whirlwind tour through OpenGL and have a massive spec for the game I'm suppose to produce my christmas. A FPS style thingy.

Thursday, October 12, 2006

Beware Of Shadows

I'm doing about a scheme sample a day and "something on Einfall". Yesterday I evaluated an entity library and decided it was totally unworkable. (It was quite inefficent and far too heavily skewed towards NPCs rather than just plain items.) Also I'm doing the lab tutorials. The last one was procedurally generating a cylinder in vertex and index array and then spitting it out. It was hard and it sucked. Mine works but it sucks. (I'm saying it's finished despite the fact that if you turned culling on, half of it dissapears. Half way through I need to flip the winding of the polygons but no - it's done now :D) I've actually reached all my goals today, a openGL tutorial and C++ one, an einfall task I set myself yesterday, some scheme work and some reading. Yay me.

How to be a 3D Game Programmer before Christmas*



There are two main areas of self study, C++ and OpenGL. These are extremely abrieviated. Also they are bolstered by lectures and university library which are possibly hard to come by at home :D Some of these steps are things I did but weren't actually required.

OpenGL



*Get a triangle to the screen.
*Experiment with glBegin() glEnd() and their various arguements.
*Experiment with colours and glClearColor
*Rotate the triangle, you're not allowed to use glRotate. Translate it too.
*Spin the triangle according to the amount of time passed since the last frame.
*Draw a circle (use the triangle fan)
*Learn about glPushMatrix and glPushMatrix.
*Create a cube and draw cube function.
*Have a small red cube rotate around a rotating blue cube. (you can use glRotate)
*Investigate culling, turn culling on. Ensure your cube still draws correctly.
*Create a function that draws a cylinder.
*Create perspective matrix. Experiment with the various perspective modes and arrangement.
*Understand what the near plane and far plane are, now give them sensible values.
*Create a light
*Create a number of lights and explore the all the parameters for lights.
*Rotate the lights so that they circle a spinning cube.
*Create a new cube generation function, this function will generate normals, you can also set a subdivision parameter that will set how the sides are divided up. So all sides of the cube might be made up of four planes.
*Explore the various properties of materials.
*Texture a cube.
*Texture a disk.
*Understand how a terrian map works.
*Using vertex arrays and index arrays create a cylinder class.
*Create four seperate windows that show a scene from 4 different views; top, side, perspective, front. You can repeat the rendering code four times.
*Create a program that creates texture and allows you to draw on it so that left mouse button draws blue lines, middle mouse button green lines and right mouse button yellow. Now expand this program into a simple paint program.
*Add a clone brush.
*Don't use a texture instead use glDrawPixels
*Print text to the screen using a simple function.
*Be able to print the text at any x,y,z coord.
*The text should be coloured according to the last glColor call.
*Create a lit scene, with a central large sphere. Give this sphere a yellow material. Now have a sphere orbiting the sphere. Give this sphere a blue material. Now have another sphere orbiting the blue sphere, colour this final one grey. Yes it's suppose to be a model of the solars system - make the rotations correct, so years / days are represented. Add some more planets. Texture all the planets. Be able to rotate the camera around them. Finally create an additional view window so you can observe the planets from a different view (it's okay to redraw the scene to do this)
*Create a plane, use the ARB multitexturing extension, have two textures on the plane. One a base texture, the other on top some parts are see through. Now have both textures rotating in opposite directions. Now create a box above the plane, have each face of the box multitextured and animated. Above the box add a sphere, with a map of the earth, add a rotating cloud layer using multitexturing.

... I'll update this later. I'm still suppose to be working. I just wanted to check out this blogger beta label stuff! :D

C++



*Write a program using the stl with cout and cin that translates celsius to fahrenheit (or vice versa)
*Know boolean stuff, switch statements, if else clauses. All the basic stuff.
*Learn how to use the VS.net debugger, step through, break points, checking values while the programs running etc.
*Now we get a little more tricky. Write a program that will take in 3 colour values RGB then pack these 3 values into a single integer. To make sure you've got it correct, unpack these integers afterwards.
(If you're thinking - that's a bit of leap! The guy who was making the tutorials changed) I interpretted this as the 3 colour values are 0-255.
*Write a program that will search for a word in a file and tell you the line number and word number.
*Write a program that will solve quadratic equations for imaginary numbers. Well this made me wish I'd taken A-level maths :D Make it fast. Make it output the two roots to three decimal places.
*Write an number of functions using passing by reference, value and using pointers.
*Write a program that can parse a text file with brackets and then format the brackets nicely using tabs. Next a few numbers somewhere in the nested brackets. You program should be able to get the highest number and write out is nexting level. Use streams! e.g.

{
{
{
{
2
}
{
}
}
}
{
{
{
20
}
}
}
}
{
10
}

*Do the above program but don't use any looping constructs. (use recursion)




*Requires a decent undergrad degree in computer science, supposedly.

Thursday, October 05, 2006

Suprises

So I thought when I took this Game Programming course I'd happily blog along what I was learning while I learnt but this looks unlikely. There's just too much stuff and too much of it is just a list of stuff to learn. I'll defintely write some things up. But at the moment we all go the labs in the morning, bash our heads against openGL (which is made much easier by having an oo wrapper that just lets you get on with the opengl code). Then usually we leave late at night. It's something that's much easier to do in a group because you have an element of competition - if he's still working I can't go home just yet etc. It's hard to find that motivation on your own.

Anyway I have to go now. Blog posts may be down this year :D