Thanks for the link Richi007, I'll be sure to look into that! laugh

Ok, now I have yet another question!

In my game I want to allow the player to select multiple units through a selection box. I currently use "mouse_dir3d" to c_trace into the 3D world from the camera position and issue orders, select units, etc. However, when the user creates a selection box and lets go of the mouse button, the game needs to "trace through" all of the pixels in the selection box to see if a unit resides there.

Basically the loop looks like this:

Code:
for( x=box_start.x; x<box_end.x; x++ )
   for( y=box_start.y; y<box_end.y; y++ )
   {
      // do some tracing!
   }



My problem is that while mouse_dir3d handles all of the calculations that determine the direction vector for tracing, those calculations aren't made available for me to modify and apply to any pixel on the screen (rather than the one the pointer currently resides on). So how can I "trace into" a pixel on the screen without moving the mouse and using mouse_dir3d?

Last edited by Redeemer; 12/25/10 02:26.

Eats commas for breakfast.

Play Barony: Cursed Edition!