Skip to main content
GameDev.net gamedev.net
🔒 Locked

Bullets

Started by cavendish Jan 9, 2004 at 2:30 PM 3 replies 1.1k views
Original Post
cavendish
cavendish
Hi guys! I'm making a small game and I've reached the part where bullets fly around. . I wanna ask you how to make those bullet marks on the walls, when a bullet hits a wall I want to create and draw a bullet 'hole' on the wall. How do I do this? Thanks [edited by - CavenDish on January 9, 2004 3:32:42 PM]
--------Whatever
Enokh
Enokh
You need to get the exact collision xyz between the bullet and the wall, then draw a 2D quad on that point that''s rotated in the Z axis in the same angle as the wall.
Eric Lengyel
Eric Lengyel
See Mathematics for 3D Game Programming and Computer Graphics , Sections 9.1 and 9.2:

http://www.terathon.com/books/mathgames2.html


This describes how to clip a decal to an arbitrary mesh (so you can put bullet holes on any surface) and offset its depth so that it's not fighting with the wall in the z-buffer.

[edited by - Eric Lengyel on January 9, 2004 5:50:37 PM]
cavendish
cavendish
Thanks!
I am able to determine the point/orientation of the bullet hole. But I was wondering if I should mess around with the texture or if I should just draw a quad/particle where the bullet entered the wall
--------Whatever
Ingenu
Ingenu
Quad/PointSprite where the hit occured, that''s how all games handle it, that''s called ''Decals'' AFAIR.

Carefull about the position of the quad, cause it might cause some Z-fighting, and you also need to make it // to the ''wall'' surface.

Also not that the ''hole'' might be in the air partially if you strike the edge of a wall, that''s a bit weird to see, but that happens in commercial games also.

-* So many things to do, so little time to spend. *-
-* So many things to do, so little time to spend. *-

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.