Jump to content


collision detection coding


  • You cannot reply to this topic
4 replies to this topic

#1 adr

    Member

  • Members
  • PipPip
  • 36 posts

Posted 05 November 2005 - 02:23 AM

Hi I am still new to doing 3d things. I get some of the basics of C++ and I am trying to learn more about C++ with gaming. I was working on a small 3d room with a panda inside it moving around. <I am using panda game engine, LOL> but when he gos to a wall... he kinda... goes into/out of the wallXD ^.^; so I was trying to see what code is needed with collision detection. I know this code wont work but I dont fully get itXD If <name> speed = 0
then = stop

#2 Mihail121

    Senior Member

  • Members
  • PipPipPipPip
  • 1052 posts

Posted 05 November 2005 - 10:22 AM

I'm afraid it's not that simple :) Collision detection is generally a pretty big topic to be covered in a single if/then statement. Make sure you got you're programming skills on a decent level and then check the numerous collision detection articles on the net.

#3 hauptman

    New Member

  • Members
  • Pip
  • 8 posts

Posted 05 November 2005 - 02:35 PM

Collision detection isn't a trivial topic.
But you could look out: Most engines have a built-in support for collision detection.

However, I wouldn't recommend jumping into 3D programming while you're just learning C++. Could be pretty frustrating ...

#4 adr

    Member

  • Members
  • PipPip
  • 36 posts

Posted 05 November 2005 - 05:36 PM

I know its not just a smpile if/then form. I work on 2d befor so I know some what goes into it, I just dont know how c++ does it mostly, I havnt really found anything on it but i'll keep looking. And I am asking b/c I want to learn C++ the hard way I guessXD I kinda learn that way^.^; but thanks anyways everyone.

#5 hauptman

    New Member

  • Members
  • Pip
  • 8 posts

Posted 05 November 2005 - 06:35 PM

So take a look at the topic of Bounding Boxes.
Basically this is a cube or a sphere which wraps about your object. So you will only have to test if these bounding boxes collide (what is easier than checking if your complex polygon (for you your Panda) collides with the wall).





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users