Monday, 9 February 2009

tplVector

I've looking for code snippets for a while. Today I've found "Snipplr", a on-line source code repository, and it came to solve my code posting needs.

I've coded tplVector, a template class with nice operator overloading to deal with vectorial arithmetics.

Saturday, 7 February 2009

On the beginning there was only darkness

I'm a little stucked on lighting because the normals; then, Analytical Geometry there I go...

I've found the Paul's Online Math Notes and it had helped me a lot with my revision. Ok, to be honest I did not get too deep into it, just vectorial stuff needed to understand normals, cross products, etc.

After some reading I've developed a template class (tplVector) with nice operator overloading to deal with vectorial arithmetics and so on. I'll post it here later after some more debugging - it looks stable, until now.

Bellow, I hope, the last of non lit snapshots:



This colorful effect can be obtained by setting the glColor (vertex by vertex) to the same values as the vertex coordinates (Red = x, Green = y, Blue = z). How? OpenGL interpolates the missing colors from the given vertexes color data.

Friday, 6 February 2009

cryptex.org

Today I got my share of Robert Langdon's paranoya...

I opened my e-mail box at morning as I usually do every day, expecting to pick up the good messages among the ton of junk/spam/pishing that the filtering had not grasped.

My average new (good) e-mail count is toward something like 20 or like (not so much for most people standards, I know). Today I got just one new e-mail, from nobody less than Justin Nevins - the artisan that model real cryptexes for sale - from cryptex.org.

Damn... I've just started out this stuff. How did he find me? It must be some kind of conspiration...

Thursday, 5 February 2009

Better?

After debugging and debugging I present you some more samples of my progress into OpenGL.

A circle.

Can you see one of the Cryptex rings here?

Better now?

Hollow version.

Yes, I know I've told you "next time" I would put better stuff, but I'm loosing too much time with debugging (C++). Next time - after some vectorial revision - I'll try to put better rendered stuff. Lights, normals, materials ahead.

Wednesday, 4 February 2009

Spiderman

Step by step I've done almost all my C++/OpenGL/GLUT deja-vu exercises:

  • C++ (e-v-e-r-y-t-h-i-n-g!)
  • Makefiles
  • GLUT callbacks;
  • OpenGL transformation matrices (stacking, projection, modelview, etc.);
  • Camera views (Perspective, Ortho, aspect ratio, etc.);
  • OpenGL geometric primitives.
I need to study more maths, afine transformations should be my next target.

Check bellow some awful fun:

glutSolidSphere

glutWireSphere

Spiderman's web

I'll try to post something better next time.

Tuesday, 3 February 2009

~mbfGL( )

OK, bad idea.

The effort necessary to encapsulate GLUT/freeglut in a single class is an herculean task.

What I'd accomplished until now was:



As one may notice the mbfGL class is made of static members. So, actually speaking, it's a lie.

After some forum scrutinizing I've concluded that Qt is what I'm looking for: an OO approach to OpenGL needs.

For now, I'll remain coding on freeglut.

Qt scheduled.

mbfGL( )

As said before, I'm drafting an OpenGL framework.

No. I don't mean to replace GLUT, freeglut, or the like... I just want to have a generic handy code to plot on screen.

mbfGL is just GLUT/freeglut encapsulated in a class. For now, I've just transcribed NeHe - Lesson 2 into it.

It compiles well, but I think I'm commiting some linkediting mistake, because I can't separate the class implementation (mbfGL.o) from the module that contains the main function: it returns a "undefined reference to main" error. The solution for now is to linkedit all together (mbfGL.cpp and main.cpp).