Thursday, 26 February 2009

Carnival and Qt

Hey there!

Brazilian Carnival happened from 02/21 to 02/25. Among very other things, Carnival is about creativity, happiness and so on...

As a traditional geek and confessed NERD, I hate Carnival - although I do appreciate very much the hole days - and had spent some time learning about Qt.

As I said before, to transcribe glut/freeglut to an OO approach is an Herculean task... and albeit that statement, looking back at my classes, that is still my feeling: I'm reinventing the wheel.

So... I'll stop at my paused development to study Qt a little more. Thank God I've found a good tutorial about it.

Saturday, 14 February 2009

Incomming Stuff

I'm a little away from here, but I did'nt give it up.

Currently I'm encapsulating small portions of some useful "gl" functions like:

  • glLight and glLightModel = (clsLight, clsSpotLight, clsLightModel)
  • glMaterial = (clsMaterial)
After reviewing my errors, the above classes are behaving nicely. About the errors? Well, It was actually bad timing when activating the OpenGL state machine.

I'm also working on camera views and developing a default rendering framework to actually model the Cryptex.

I'll post the classes when the "framework v1.0" is minimally debugged.

Wednesday, 11 February 2009

It works!

My fault was to start from complexity. I designed a "powerful" class that acctualy did nothing. Yes, I know, sounds lamme and stupid, but when you mix, C++ programming, computer graphics and rigorous software engineering, sometimes the ground disapears bellow your feets. It just got too complex.

The bellow sphere was hard corded, and it works.

That makes me think that I must review my failed attempts, with lots of overloading, constructors, pointers, etc.

Lighting is hard


I'm having a hard time with lighting. I'm developing a clsLight to deal with basic issues, but for some unknown reason I'm letting something slip through my fingers.

Lighting seems to be a "dark" place to one adventure himself. Albeit the large number of OpenGL tutorials into the Internet, I'd not found anything deeper than "the lit sphere" cases...

My time on Cryptex 3D is becaming scarce also, as some professional duties are taking precedence over it.

Monday, 9 February 2009


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

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

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

Thursday, 5 February 2009


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


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:



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).

Monday, 2 February 2009

Home work

I got no news today.

I was, once, a good C++ programmer. I still knew how to do it... I just can't remember all the details. Anyway, this is the main focus of the project: (re)learn by fun.

Today I'd done some research:

  • C++
  • makefiles
  • automatic documentation
  • on-line code snippets gadgets
  • GLUT (that now came into being freeglut)
That's all on the Linkography section.

I did also some exercises, and begin to draft an OpenGL framework of mine. Bugs, bad code, warnings, errors, all the noob dilemmas are back again...

Sorry if you can't find here a detailed description of all my steps. I don't work that way. I usually research a bit here a bit there, changing topics as fast as I change TV channels when it gets boring. Be cool, no beer while researching, I swear.

Sunday, 1 February 2009

Google 3D Warehouse

Well, after some more browsing I've found the Google 3D Warehouse - an on-line repository of 3D models of all kinds.

There I've found those (click on the image to see it 3d):

I think it can give me a good starting point.

Although I need to find the .skp file format documentation.

Oh my God! What a shame!

It already exists! What a lack of creativity of mine...

It seems that Cryptex of Time fulfills my initial proposal. And it seems very, very cool indeed!

Well, I'll need to learn to live with that. I just think it will demand some time...


OK, done.

It seems that someone also had done something similar here:

This model was conceived in 3d Studio Max. I think it don't met all my programming issues, however it can give me some visual standards about all the hard work I'll have ahead.

The idea

Well, this project had come into being from my necessity on remembering some Computer Graphics topics, and from my pragmatic way of learning from practice.

It's flickering for a long time, like a lamp in a night of blackouts and lightnings, turning itself on and off as my laziness, responsibilities, priorities and many others issues took precedence over it.

Now, I don't know if it'll be very different as before, but at least I'll try to keep record of it.

Oh yes! The idea... I'd almost forgot it.

My main objective here is to model a computational 3d cryptex. And to make it rotate, open, and hold some secret information inside (of course). For now, I'll not load much more than this, as I'm searching the web for some prerequisites I need to remember before starting into it. I swear that I'll try to keep record of all my steps from now - maybe some link section.

Sorry for you, dear reader that had born in a English spoken country for reading this blog, but I think that my records would be more useful in your international idiom - albeit I'm being self taught on it. Any corrections are welcome - both in grammar and content 'per se'.