Jump to content
  • Advertisement
Sign in to follow this  
Medo Mex

Detecting Billboards

This topic is 1871 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

When the player shoot, I draw a bullet impact billboard, sometimes the player shoot at the same target multiple times, I don't want to place multiple billboards over each others.

 

How do I detect if a billboard already exists, so I only draw it if no billboards exists on the hit point?

 

D3DXVECTOR3 triangleP0, triangleP1, triangleP2; // Intersected triangle
D3DXVECTOR3 pHitPoint; // The hit point

// --> I want to use if () statement to check if a billboard already exists here...

// Code to draw billboard here...
Edited by Medo3337

Share this post


Link to post
Share on other sites
Advertisement

@ankhd: The player could shoot at: 2.0f, 1.8f, 1.0f

 

Then shoot at: 2.0f, 1.4f, 1.0f

 

Notice, it's not the same hit spot but I shouldn't be drawing the billboard since it will still appear over another one.

 

See the sceenshot, two billboards appears over each others, I want to AVOID that:

[attachment=15634:bboard1.png]

[attachment=15635:bboard.png]

Edited by Medo3337

Share this post


Link to post
Share on other sites

They don't look ok, take a look at the following screenshot:

[attachment=15638:bboard2.png]

 

I want to avoid that.

Share this post


Link to post
Share on other sites

You could calculate the distance between position of "billboard" that you want to place against position of each existing "billboards" and if it is smaller then some value  do not add it to the world. Hint: D3DXVec3LengthSq

Share this post


Link to post
Share on other sites

The average. Though, you probably had the quad created from some center point, which you could use as well.

Share this post


Link to post
Share on other sites

In some games, I notice they place bullet impact billboards over each others, though they still look realistic.

 

In my case, If I draw multiple billboard over each others, they don't look realistic.

 

Do I only have to change the texture to another one that can appear realistic when placed over each others? Maybe there are some techniques like resizing existing billboard before drawing another one over it?

Edited by Medo3337

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!