Hover Entity

Started by
6 comments, last by riuthamus 11 years, 9 months ago
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....

gallery_1_371_248548.jpg

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?
Advertisement
what you need is a ray/box collision test (or an SSE version), and if you want to apply it to a specific face, this thead on SO 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)
Thank you, we will give this a shot and if it works I will post it here, with a screenshot!
hm... seems you have what i need mistaken. We use those functions to actually place blocks. What i want is to do the following.

gallery_1_371_78307.jpg
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.

Niko Suni


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.


would that be placed on top of the current block? or would it override that face all together?
I would draw the overlay as a separate quad. This way, you don't have to modify the code that renders the cubes.

Niko Suni

Got it workng, thanks for the help.

This topic is closed to new replies.

Advertisement