Jump to content

  • Log In with Google      Sign In   
  • Create Account

Hover Entity


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 riuthamus   Moderators   -  Reputation: 5500

Like
0Likes
Like

Posted 24 June 2012 - 08:23 AM

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

Posted Image

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?

Sponsor:

#2 Necrolis   Members   -  Reputation: 1330

Like
1Likes
Like

Posted 24 June 2012 - 08:36 AM

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)

#3 riuthamus   Moderators   -  Reputation: 5500

Like
0Likes
Like

Posted 24 June 2012 - 08:46 AM

Thank you, we will give this a shot and if it works I will post it here, with a screenshot!

#4 riuthamus   Moderators   -  Reputation: 5500

Like
0Likes
Like

Posted 24 June 2012 - 11:17 PM

hm... seems you have what i need mistaken. We use those functions to actually place blocks. What i want is to do the following.

Posted Image

#5 Nik02   Crossbones+   -  Reputation: 2832

Like
1Likes
Like

Posted 25 June 2012 - 12:33 AM

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, 25 June 2012 - 12:43 AM.

Niko Suni


#6 riuthamus   Moderators   -  Reputation: 5500

Like
0Likes
Like

Posted 25 June 2012 - 12:51 AM

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?

#7 Nik02   Crossbones+   -  Reputation: 2832

Like
1Likes
Like

Posted 25 June 2012 - 12:55 AM

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


#8 riuthamus   Moderators   -  Reputation: 5500

Like
0Likes
Like

Posted 25 June 2012 - 02:24 AM

Got it workng, thanks for the help.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS