gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > How to get the current MODELVIEW matrix

#111373 - DigitalRider - Tue Dec 05, 2006 11:40 pm

I am trying to get the MODEL VIEW matrix and modify it. I see there's a glLoadMatrix in VideoGL.h but I didn't see any function to GET the current MODELVIEW matrix. I am trying to make this message as short as possible but I hope i am not over simplifing the problem. Thank you very much.

#111375 - DiscoStew - Wed Dec 06, 2006 12:18 am

There are 2 functions described in the videoGL.h file as glGetInt and glGetFixed. This is what will get you the Model View matrix. The GL_GET_TYPE type is located amongst the other constants, and the pointer parameter is where the matrix will be written to.

However, if you want to manually get the matrix without going through these functions, just access the 64-byte region at address 4000640h (which is called the CLIPMTX_RESULT at GBATek).


At the moment though, from the tests I've done, only No$GBA seems to have this feature (other than hardware), so if you are using other emulators, you'll only get 0s.
_________________
DS - It's all about DiscoStew

#111396 - DigitalRider - Wed Dec 06, 2006 5:42 am

THANK YOU VERY MUCH!!!! T_T I am going to try it out right way, thanks a million.

#111454 - Payk - Wed Dec 06, 2006 6:51 pm

Yeah thanx DiscoStew, i always searched for it :D