Entity edge highlight)

Source: Internet
Author: User

Source: http://www.cppblog.com/lai3d/archive/2007/11/18/36899.html

After the mouse in the game is at the intersection of an NPC, the edge of the NPC is highlighted or how to deal with it, so that the player can clearly know that the NPC can be selected by clicking it. The sword of Excellence has this effect. Google does not find any relevant information.

My question on gamedev:
When the cursor is over an entity, I want to highlight it's edge so that a player can immediately know he can pick this entity after he click the mouse left button. for example, there are missing monsters around the main character in the game, it is not easy to pick one monster. I googled this, but found nothing. who can give me some suggestion?

A foreigner's answer:
The simplest method is to draw the object colored in the highlight color, with some scaling to make it larger than the original object. do this drawing with depth writes turned off. then, after this, draw the object as usual, with depth writes on again. there are more complex methods, depending on your application-depending on what is your bottleneck, depending on complexity of your monster models etc. but the method above is simple to implement and shoshould work for most cases.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.