views:

82

answers:

1

I'm working on a 3d game just for learning.

I have a 3d world generated from a heightmap and various mesh based objects overlayed onto that world.

I want the player to be able to target objects in the world which I can do, but I want to draw a targetting circle on the terrain or object that the targetted thing is standing on. If you've played world of warcraft you'll know what I mean, when you target someone it draws a red circle onto the floor below them.

But it's projected onto whatever they are standing on. Which might be the terrain - and therefore might need projecting onto different mesh polygons with different slopes, part o fthe circle on one and part on the other. Or might need projecting onto an item. Or possibly part on one and part on the other.

Any ideas how to do this efficiently? Cheats and approximations are welcome too, as usual in games I'm looking for something looks effective rather than 100% correctness.

Using directx9 and shader model 2 if that matters at all for any solutions.

+1  A: 

one nice approach is to use a light-source. Simplistically, shine a touch down onto the item you want to highlight, and let the rest all be in the shade.

Computationally expensive, but programming wise its to just use the lighting functions in your Direct3D tool-kit of choice.

Will
I really need a texture to be projected but this is a good answer
John Burton