glloadmatrix 4x4?

Post Reply
slenkar
Posts: 43
Joined: Sun Apr 17, 2011 8:10 pm

glloadmatrix 4x4?

Post by slenkar » Thu Apr 21, 2011 9:28 pm

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]

User avatar
Izhido
Posts: 107
Joined: Fri Oct 19, 2007 10:57 pm
Location: Costa Rica
Contact:

Re: glloadmatrix 4x4?

Post by Izhido » Fri Apr 22, 2011 6:20 pm

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?

slenkar
Posts: 43
Joined: Sun Apr 17, 2011 8:10 pm

Re: glloadmatrix 4x4?

Post by slenkar » Fri Apr 22, 2011 6:33 pm

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,

slenkar
Posts: 43
Joined: Sun Apr 17, 2011 8:10 pm

Re: glloadmatrix 4x4?

Post by slenkar » Sat Apr 23, 2011 2:29 pm

how do you call the function?

it needs a m4x4 struct

zeromus
Posts: 212
Joined: Wed Mar 31, 2010 6:05 pm

Re: glloadmatrix 4x4?

Post by zeromus » Mon May 16, 2011 6:47 pm

you must clear that matrix before using it. set it to identity, and then set your rotate and translate parameters.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests