# Hmm all the transformation's passed to opengl

Okay here is what i am trying to do… is i am trying to make my own gltranslate function basically with out conventionally glMultMatrixf or glLoadMatrix… so i decided to do a little research and here is what i came up with… that if you group objects to move the same ( i call it clustering ) then i assign it a

float m[16]

btw the code is all in C.

so the structure goes

cluster(contains triangles and numtriangles and [obj matrix])
->
triangle which contains vertexes
->
vertexes which contain x,y,z,u,v

so i made my own glulookat function and decided to begin from there… i got everything working for the glulookat function (my implementation) i could walk around and all, strafe movement with mouse. so now i want to really see how OpenGl works by doing this little project.

But i need some help. My algo in pseudocode:

T=transformation matrix.
cluster.objmatrix=clusters matrix
res=result

MatrixBy= Matrix multiplying

(maybe i am doing this wrong I haven’t really looked into it. I got it off a site who offers sound advice–not a good practice, but for times sake i decided to.)

glGetFloatv(GL_MODELVIEW_MATRIX,m)
//^ not sure about this… don’t think i need it

MatrixBy( T, cluster.objmatrix, res );

MatrixBy( res, m, res );

and then for each vertex i multiply it by a triangle vertex…

sector1.triangle[triloop].vertex[0] = MatrixbyVertex(res,sector1.triangle[triloop].vertex[0]);

then i draw each triangle in a loop if you want my code just request it.

Thanks for listening,
Dan

Does Anyone know this is kinda important i now there opengl gurus out there

Dan

Haha figured it out…

-first off my math was bad (don’t get **** off the internet and not check it).

-second off i was changing the world coordinates(hehe not enough JOLT) and i wasn’t translating after i was rotating

-third didn’t have update u v texture stuff.

-fourth i was intermixing float[16] 1D matrices with 2D so that is bad i stuck to just 1D.

-fifth no one will ever read this so why am i writing it…

Dan

I was reading it, but u have been faster than me…

rIO.sK www.spinningkids.org