TomorrowPlusX
2006.09.14, 06:00 PM
Could somebody help me with implementing my own gluUnProject? I read the manpage to learn how it works but I'm a little uncertain... I unfortunately threw out my own implementation ( which didn't work ) months ago in frustration or else I'd post it here for you all to help me with.
The reason I want to write my own is I'm about to write some code which will use gluUnProject heavily -- right now I'm wasting a bit of time converting my modelview and projection matrices from floats to doubles each time I call gluUnproject. It would be nice to have a gluUnProjectf which doesn't need to work with doubles...
Thanks,
(specifically, the situation is that I'm implementing render to texture for my user interface code so you can have a working UI in 3d in a game, say on a computer screen in a room or whatever. To be able to interact with this UI, I need to be able to convert mouse coordinates to a vector in world space which I can then do plane intersections with to get the location on the virtual screen in the 3d world. It would be nice to not have to convert 2 4x4 float matrices to double with each update of the game state... my wee powerbook is taxed enough as it is )
EDIT:
I'm a big fat idiot. I found the gluUnProject source in MESA... nevermind. Moderators, delete me if you want.
The reason I want to write my own is I'm about to write some code which will use gluUnProject heavily -- right now I'm wasting a bit of time converting my modelview and projection matrices from floats to doubles each time I call gluUnproject. It would be nice to have a gluUnProjectf which doesn't need to work with doubles...
Thanks,
(specifically, the situation is that I'm implementing render to texture for my user interface code so you can have a working UI in 3d in a game, say on a computer screen in a room or whatever. To be able to interact with this UI, I need to be able to convert mouse coordinates to a vector in world space which I can then do plane intersections with to get the location on the virtual screen in the 3d world. It would be nice to not have to convert 2 4x4 float matrices to double with each update of the game state... my wee powerbook is taxed enough as it is )
EDIT:
I'm a big fat idiot. I found the gluUnProject source in MESA... nevermind. Moderators, delete me if you want.