Shooting gallery
by John Carroll · in Torque Game Engine · 08/08/2006 (1:06 pm) · 3 replies
Hi,
I would like to modify the engine such that the camera is locked. The players position in relation to the screen is known. The player shoots a light gun or some such, and we come up with a pixel location that the light gun hit. We then initiate a projectile and send it down range from that pixel location using the known angle of the shooter to that pixel on the screen (we're talking a 16' x 9' screen) and seeing what if anything the projectile hits. This will probably require something other than the usual perspective transform for the projection (probably something like D3DXMatrixPerspectiveOffCenterLH from D3D). It would also require being able to tell torque to initiate a projectile at some location on the screen at some given angle. Is this possible?
--John
I would like to modify the engine such that the camera is locked. The players position in relation to the screen is known. The player shoots a light gun or some such, and we come up with a pixel location that the light gun hit. We then initiate a projectile and send it down range from that pixel location using the known angle of the shooter to that pixel on the screen (we're talking a 16' x 9' screen) and seeing what if anything the projectile hits. This will probably require something other than the usual perspective transform for the projection (probably something like D3DXMatrixPerspectiveOffCenterLH from D3D). It would also require being able to tell torque to initiate a projectile at some location on the screen at some given angle. Is this possible?
--John
About the author
Working on using Torque as an Image Generator for Tactical Simulations under laser and live fire conditions, for Law Enforcement/Military applications.
#2
08/21/2006 (12:00 pm)
More likely that no one has tried it yet. Locking the camera is easy enough (through a variety of means). Getting a true orthographic view might be tricky, not sure. As for the meat of it, you will probably need some variation of the mouse/cursor pick functionality (located in a couple of resources I believe). The RTS pack has mouse pick built in, but you would be better off implementing one of the free picking systems. Either way, it will take a bit of tinkering with the code.
John Carroll
Advanced Interactive Systems
--John