Towards Basic Understanding

11:53 AM

Towards basic understanding

I just tried this code:

gl::translate( Vec3f(getWindowWidth()/2,getWindowHeight()/2,0) );
gl::rotate( Vec3f(35,20,0) );
gl::drawCube( Vec3f::zero(), Vec3f(100,100,100) );

(Incidentally, I’m following the tutorial here)

Now the cube doesn’t rotate, because the rotation is not being added to the model view. I’m still confused as to where the model view is being stored. Perhaps the transforms are actually being applied to the world?

The tutorial I’ve used so far didn’t get me very far. So let’s have a look futher afield.

12:54 PM

Think again…

I don’t need rotational transforms, as the world will not be rotated, only translated. I don’t need a perspective transform, as the perspective is fixed.

I will need to learn some vector maths for lighting I suspect.

It does seem silly to think of voxels. There is no projection to do, the faces presented will always be the same. Voxels make sense if we take each individual block in Chimera and turn those into voxels, with depth and so on.

In the original Chimera, each block was 16×16, voxel based this would translate to 16x16x16, or 1024 voxels. Each one could have its own material. If we were to up the resolution, this would be 32x32x32 per block, or 32,768 voxels. Still manageable if we keep the total number of blocks down. So let’s have a think about how to draw this with flat lighting.

1:21 PM

I don’t need to overthink this. What I want to do is not complex. It is simple. Strip it down. Strip it back. Think of the essence of the thing. Cubes. Three faces. They never present differently. Three faces. Six triangles. Three lighting values. This should be easy.

The very next thing I need to do is draw a Chimera map, but instead of drawing sprites, I draw voxels.

Leave a Reply

Your email address will not be published. Required fields are marked *