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....
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?
Hover Entity
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)
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)
hm... seems you have what i need mistaken. We use those functions to actually place blocks. What i want is to do the following.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement