pouët.net

Micro Code Primatives

category: code [glöplog]
 
I just rolled a tiny gl cube strip with UV using packed bitmaps, wondering if anyone else has done anything similar and wants to share shapes or has done it a different way without using asm or glut?

Code: // 14 vertex uv'd cube with correct cull winding! glBegin(GL_TRIANGLE_STRIP); for (int a=0;a<14;a++) { glTexCoord2f((0x299a>>a)&1,(0x32Ac>>a)&1); glVertex3f(((0x2F0A>>a)&2)-1,((0x63C6>>a)&2)-1,((0x55E>>a)&2)-1); } glEnd();
added on the 2013-01-25 06:17:23 by Shabby Shabby
Nice one :)
I once did something very similar, iirc it looked way more nasty - maybe I can find that thing again. :)

IIRC I unrolled the cube like this
Code: ++++++ +XX+++ ++XX++ +++XX+ ++++++

You can find a nice pattern then.
added on the 2013-01-25 09:21:24 by las las
Cool stuff Las - that strip bit pattern ecnoding is the almost the same as your unroll :)

I was thinking about extending it to 64bits and using it for more complex shapes - but I'd have to build a tool for it - and I'm too lazy :P
added on the 2013-01-25 20:46:20 by Shabby Shabby

login