Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Bullet Positioning

Author
Message
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 7th Jun 2014 12:30
Hello,

Can you guys please help me with some bullet coding? I have the code here. The fact is, when i am moving the camera with my gun, the projectiles are not positioning correctly where i placed them to pop up from the gun. If i rotate 90 degrees, the projectile will not move where the gun is. I do really appreciate your help! Thank You ver much!


Alex Matei CEO
www.alexmatei.com
VisualProg
17
Years of Service
User Offline
Joined: 31st Mar 2009
Location: RussianFederation, Smolensk
Posted: 7th Jun 2014 12:57 Edited at: 7th Jun 2014 12:58
try


MZh[NUL] <---

MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 7th Jun 2014 13:45
Hey, thank you, but the code is very slightly better but almost the same problem as in my code, when not in the position programed the bullet flies above my head or on the right or on the left etc.

Thak You, appreciate your time!

Alex Matei CEO
www.alexmatei.com
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 8th Jun 2014 12:10
Anyone any new ideas? Thank You!

Alex Matei CEO
www.alexmatei.com
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th Jun 2014 13:15
I would have some dummy limbs setup in the gun itself, well if you wanted really realistic bullets. If you take the barrel of your gun and put a limb at the start, and another one at the end, you can get the exact 3D position of these limbs, then use that to calculate the start position and velocity of the bullet. You could even use that to move an object forward from the barrel then get it's screen position for the crosshair... then there's also the possibility of adding a laser pointer dot with the same technique and some ray collision. It's also really handy when dealing with gun flare, you have the positions and vectors you'd need to have really cool particle effects and gun flares.

I prefer to add the dummy limbs in the modelling package, but it could be done with code I'm sure.

It's more complicated of course, but very accurate and can bring in a lot of realism.

I am the one who knocks...
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 8th Jun 2014 14:46
Thank you for the tips Van B

Alex Matei CEO
www.alexmatei.com

Login to post a reply

Server time is: 2026-07-06 11:07:30
Your offset time is: 2026-07-06 11:07:30