/* attempt to deal with prototype, bootstrap, jquery conflicts */ /* for dropdown menus */

Jump to content

Image of the Day

Day 17 -- a bunch more tools join the table :) #blender3d #screenshotsaturday #itssaturdaysomewhere #lowpoly #3D https://t.co/CYJucn0Lfv
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.


Sign up now

Detecting Billboards

4: Adsense

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
9 replies to this topic

#1 Medo3337   Members   

891
Like
0Likes
Like

Posted 08 May 2013 - 04:17 PM

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, 08 May 2013 - 05:11 PM.


#2 ankhd   Members   

2301
Like
1Likes
Like

Posted 08 May 2013 - 09:12 PM

You would need to keep track of the hit spots on each object

#3 Medo3337   Members   

891
Like
0Likes
Like

Posted 09 May 2013 - 01:49 AM

@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:

bboard1.png

bboard.png


Edited by Medo3337, 09 May 2013 - 05:10 AM.


#4 ankhd   Members   

2301
Like
0Likes
Like

Posted 09 May 2013 - 08:27 AM

they both look ok. use a radius as well



#5 Medo3337   Members   

891
Like
0Likes
Like

Posted 09 May 2013 - 09:30 AM

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

bboard2.png

 

I want to avoid that.



#6 belfegor   Members   

2833
Like
1Likes
Like

Posted 09 May 2013 - 09:57 AM

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



#7 Medo3337   Members   

891
Like
0Likes
Like

Posted 09 May 2013 - 06:42 PM

How do I get the position of the billboard if I have the position of the vertices v0, v1, v2. v3?



#8 unbird   Members   

8298
Like
0Likes
Like

Posted 09 May 2013 - 07:37 PM

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



#9 BornToCode   Members   

1185
Like
1Likes
Like

Posted 09 May 2013 - 07:54 PM

use the average position of all 4 vertices as your position



#10 Medo3337   Members   

891
Like
0Likes
Like

Posted 09 May 2013 - 08:00 PM

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, 09 May 2013 - 11:38 PM.





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.