| Tegid July 25, 2001, 05:51 PM |
|
Just a comment on rotating these figures. I wrote a single axis rotation fuction for blocks like these that used a
single bitshift to rotate the block. Basically, I knew the center block would always be on, then I basically
unwrapped the outside of a 3x3 matrix so that {{0,1,0}{0,1,0},{0,1,1}} became the byte 01001100.
(if you start at 0,0 then go to 0,1 then 0,2 the 1,2 the 2,2 and so on around to assemble the bits and throw
out the center value which is always 1) When I rotated (always 90 degrees) I would save the two most significant
bits, bitshift left 2 and paste the saved bits into the least significant column, then convert back. There is no reason
this couldn't be adapted for 3D and you'd be able to forget about gimbal lock (or you could use Quaternions but
they are a pain to figure out initially) because you aren't really rotating, you are merely reconfiguring a 3x3x3
array. (just an idea but I like what you have so far, I think my first GL program drew a couple of triangles, and
I still don't texture a damn thing.
|