• Advertisement
Sign in to follow this  

Hover Entity

This topic is 2035 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So, we are attempting to add a hovering face over the sides of the blocks when your mouse pointer is over that section. Sadly, we have no clue how this would be done. In a fail attempt we created this....

[img]http://www.bhslaughter.com/forum/uploads/gallery/album_371/gallery_1_371_248548.jpg[/img]

While it looks cool, it certainly does not do what we desire it to do. The object is to have that one face block with the outline glow on it. The outline glow is a .png file that has 100% transparent background.

Does anybody know how we would go about modifying or lacing over the hoverimage.png over the specific face that the mouse is pointing at?

Share this post


Link to post
Share on other sites
Advertisement
what you need is a [url="http://www.gamedev.net/topic/456667-ray-box-intersection/"]ray/box collision test[/url] (or an [url="http://www.flipcode.com/archives/SSE_RayBox_Intersection_Test.shtml"]SSE version[/url]), and if you want to apply it to a specific face, [url="http://stackoverflow.com/questions/2563849/ray-box-intersection-theory"]this thead on SO[/url] should provide the math needed for that.

basically, you shoot a ray from your camera's "eye" in the direction you are looking, the first box it intersects with is the box you'll want to put your glow on (how thats done is up to your rendering pipeline)

Share this post


Link to post
Share on other sites
hm... seems you have what i need mistaken. We use those functions to actually place blocks. What i want is to do the following.

[img]http://www.bhslaughter.com/forum/uploads/gallery/album_371/gallery_1_371_78307.jpg[/img]

Share this post


Link to post
Share on other sites
The ray-plane intersection check is even easier. After you get the xy position of the intersection (assuming z is upward and xy is coplanar to the ground plane), get the tile that contains that point. Then draw the transparent quad on that tile. Edited by Nik02

Share this post


Link to post
Share on other sites
[quote name='Nik02' timestamp='1340606009' post='4952574']
The ray-plane intersection check is even easier. After you get the xy position of the intersection (assuming z is upward and xy is coplanar to the ground plane), get the tile that contains that point. Then draw the transparent quad on that tile.
[/quote]

would that be placed on top of the current block? or would it override that face all together?

Share this post


Link to post
Share on other sites
I would draw the overlay as a separate quad. This way, you don't have to modify the code that renders the cubes.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement