Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


How to implement bullets movement in 3D world


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

#1 yanuart   Members   -  Reputation: 162

Like
Likes
Like

Posted 17 February 2002 - 04:56 AM

I have a game where I move my mouse cursor as a crosshair to target enemies, the problem is how to implement : 1. my bullets direction in 3D world 2. the best way to do collison detection of my bullets. Can somebody give me a good idea or article where I can read ??

Sponsor:

#2 krez   Members   -  Reputation: 443

Like
Likes
Like

Posted 17 February 2002 - 12:24 PM

make a bullet struct/class/whatever, which has 2 3D vectors (one for position, one for velocity). to move it, add the velocity vector to the position one every frame. for collision detection, check if the line between the bullet''s position and it''s next position intersects anything else.

#3 ZeroBit   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 February 2002 - 02:07 PM

Hi yanuar

For Bullet direction :
i would use 2 point to define the bullet front direction :
1st. the viewpoint position
2nd. unproject the mouse position at a certain z value (weapon range ?)

Then using the two points, you can define a direction vector for the bullet.
As for collision detection, i think krez''s suggestion is fine.




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.



PARTNERS