We are writing a space game where you need to "target" another object (or player, etc). We are not sure the best way to go about doing this.
We made a 2D bitmap to "highlight" the tarket (just a square box). But, we are not sure how to place the 2D item on a 3D item. To complicate matters, the targetable item may not be in the camera view.
We would like our "target highlighter" to give the general direction of the target. The "target highlighter" should never leave the camera view however would hover around the "camera edges" to show the general direction of the targeted item.
So.
1. What is the best way to go about this?
2. Is there a function that says "Is object in camera view?"
3. What (if any) function returns the (vector?) extents of the camera view?
4. Anyone else done this? could we see some code?
I suspect that we are making this more difficult than it should be. If you have done something similar we would appreciate any suggestions and advice.
Targeting another Object (or player)
There is a function (ISceneCollisionManager interface) to transform a 3D point into 2D cooridinates. This should solve your problems. If the point is outside screen space an absurdly high 2D coordinate is returned, check the docs for specifics
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.
Crucible of Stars
Crucible of Stars