Calculating the Projection Matrix
by Nachi Lau · in Torque Game Engine · 12/08/2003 (12:19 pm) · 3 replies
Hello all,
I would like to calculate the projection martix of the engine. Does anyone know where can I get this information from?
Thanks!
Nachi
I would like to calculate the projection martix of the engine. Does anyone know where can I get this information from?
Thanks!
Nachi
#2
Nachi
12/08/2003 (3:03 pm)
Actually, I want to show a dialog box at the head of the NPC. My approach is this, first I get the projection matrix of the engine, and then I calculate the head position of the NPC, and use the projection matrix to translate the NPC head position to the screen space, and then I draw my dialog box, which is a GUI object, in that screen position. That's why I need to get the projection matrix of the engine, I know how to do it in DirectX and openGL, but don't know whether I can do it in script since I don't want to bother the C++ code of the Torque engine yet.... Any idea?Nachi
#3
Unfortunately I don't see it open to script in the base Torque build. You could easily do it yourself though, look at other script functions as examples.
12/09/2003 (2:17 pm)
Ahh, OK, there is a helper function that would be useful for this kind of thing - dglPointToScreen(). It takes a point in 3D space and translates it into screen coordinates for you.Unfortunately I don't see it open to script in the base Torque build. You could easily do it yourself though, look at other script functions as examples.
Torque Owner Brian Ramage
Default Studio Name