开发者

Drawing targetting circle in 3d application

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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜