Page 1 of 1

glloadmatrix 4x4?

Posted: Thu Apr 21, 2011 9:28 pm
by slenkar
Hi could someone give me an example of how to use glloadmatrix?

I know how it works in a game but I dont understand why it needs a const

so the example i am looking for is something like:
m[0]=0
m[1]=0
m[2]=1
m[3]=1
m[4]=1
m[5]=1
m[6]=1
m[7]=1

glLoadmatrix4x4[m]

Re: glloadmatrix 4x4?

Posted: Fri Apr 22, 2011 6:20 pm
by Izhido
Um... if you already know how glLoadMatrix works in a game, then what is your actual question? What is it that you actually do not understand? Could you please clarify us about that?

Re: glloadmatrix 4x4?

Posted: Fri Apr 22, 2011 6:33 pm
by slenkar
I want to know how to call the function

i did some research and came up with this:

struct m4x4 ma;
ma.m[0]=ix;
ma.m[1]=iy;
ma.m[4]=jx;
ma.m[5]=jy;
ma.m[12]=tx;
ma.m[13]=ty;
glLoadMatrix4x4(&ma);
It compiles but my graphics dissapear off the screen.

I am drawing some graphics successfully and I want to scale everything down to fit the DS screen
instead of changing all my co-ordinates I want to simply set the matrix to scale everything down

I am drawing a line to test this, when I load the new matrix (with the above function) the line dissapears (instead of getting smaller)

you may ask, "why not use glScale?"

because I am making a wrapper for another language that needs the loadmatrix command only,

Re: glloadmatrix 4x4?

Posted: Sat Apr 23, 2011 2:29 pm
by slenkar
how do you call the function?

it needs a m4x4 struct

Re: glloadmatrix 4x4?

Posted: Mon May 16, 2011 6:47 pm
by zeromus
you must clear that matrix before using it. set it to identity, and then set your rotate and translate parameters.