| We hope you enjoy your visit. You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you are already a member please log in to your account to access all of our features: |
| Bouncy Bullets | |
|---|---|
| Tweet Topic Started: Jan 15 2013, 05:53 AM (234 Views) | |
| From Soy Sauce | Jan 15 2013, 05:53 AM Post #1 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
Hey guys, I was wondering how I could make a gun that shoots bullets that ricochet when they hit walls/ceiling/floor. Like the Judicator from Metroid Prime Hunters: http://youtu.be/z_GeoRC71BI?t=1m17s |
![]() |
|
| Reikyrr | Jan 16 2013, 12:12 AM Post #2 |
|
Forum God
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
You probably want these
And
And you'll need to use vectors. Look it up in the manual. The normal points from the intersected triangle to the front. Using that you can calculate bullet ricochet. |
|
~Inspirational quote~ | |
![]() |
|
| RonBurgundy | Jan 16 2013, 02:14 AM Post #3 |
|
Forum Borat
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
If you can wait, I'll find my hockey game and give you the snippets. |
| !!! DEFEND POP PUNK !!! | |
![]() |
|
| From Soy Sauce | Jan 16 2013, 03:52 AM Post #4 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
Ooo sounds good! |
![]() |
|
| RonBurgundy | Jan 16 2013, 05:18 AM Post #5 |
|
Forum Borat
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Couldn't find it. However lucky for you, I found this snippet in an old post of mine.
This wont work accurately, at least not according to physics. But I htink with some adjustments you can get it working that way. Hopefully this guides you in the right direction. EDIT: Maybe, MysteriXYZ would have been proud Edited by RonBurgundy, Jan 16 2013, 05:24 AM.
|
| !!! DEFEND POP PUNK !!! | |
![]() |
|
| Dr. Best | Jan 16 2013, 01:20 PM Post #6 |
|
Administrator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
The physically correct formula is here:![]() It can be implemented with two invocations of CalculateDotProduct(), one division and multiplication by two, one invocation of CalculateVectorScalarProduct() and one invocation of CalculateVectorDifference(). Actually the divisor, which originates from the normalized vector GetRaytracingNormal(), is always one, so one scalar product the division can be omitted. You end up with this formula: (Change the theme of the forum, if you can't read it). |
![]() |
|
| RonBurgundy | Jan 17 2013, 01:53 AM Post #7 |
|
Forum Borat
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
The v is the normalized vector correct? I'am trying to figure out what a is or rather what to put in for a. |
| !!! DEFEND POP PUNK !!! | |
![]() |
|
| Dr. Best | Jan 17 2013, 02:07 AM Post #8 |
|
Administrator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
v is the velocity vector of your bullet or more generally speaking the vector you want to reflect. It does not need to be normalized. a is the vector you obtain from GetRaytracingNormal() or more generally speaking the normalized normal vector of the plane on which the vector is reflected. In the following formula the first multiplication-dot denotes common multiplication of real values, the second one denotes a dot product, and the third one denotes a scalar product. EDIT: The listing of multiplication dots was wrong previously, because I overlooked the multiplication by two. It is fixed now. Edited by Dr. Best, Jan 17 2013, 02:23 PM.
|
![]() |
|
| RonBurgundy | Jan 17 2013, 03:35 AM Post #9 |
|
Forum Borat
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Thanks for the help Doc. I'll get this working correctly, and FromSoy if you still need help with this let me know. |
| !!! DEFEND POP PUNK !!! | |
![]() |
|
| From Soy Sauce | Jan 17 2013, 06:14 PM Post #10 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
Thanks Dr. Best. @ Ron, I'll try something out, and see what happens. Edited by From Soy Sauce, Jan 17 2013, 06:25 PM.
|
![]() |
|
| « Previous Topic · Questions about Ultimate 3D · Next Topic » |





![]](http://z1.ifrm.com/static/1/pip_r.png)





2:21 AM Jul 11