3D collision question

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
like80ninjas
Chaos Rift Regular
Chaos Rift Regular
Posts: 101
Joined: Thu Dec 09, 2010 2:13 am

3D collision question

Post by like80ninjas »

Sup Bros, I'm interested on your opinions on my situation.

I'm making a 3D platformer in the same vein of the N64 greats. All of the art assets are low poly to achieve the
style of the N64 games ( banjo, mario, conker etc )

I'm using a .obj model as my map, they aren't very high poly, but I want the player to collide with them on a triangle bases ( I think ). What would be the best way to do so? or the most common? I'm going to use a bounding object for the characters, either a sphere or an OBB/ABB, so I'd like to know if you guys would suggest just testing the bounding object against the triangle mesh? some other method? or just get a physics library and call it a day?
User avatar
superLED
Chaos Rift Junior
Chaos Rift Junior
Posts: 303
Joined: Sun Nov 21, 2010 10:56 am
Current Project: Engine
Favorite Gaming Platforms: N64
Programming Language of Choice: C++, PHP
Location: Norway

Re: 3D collision question

Post by superLED »

1: Make the world mesh
2: Place cubes/spheres over collidable objects and give it's material's name "collide_cube"/"collide_sphere".
3: When loading in the .obj, if the material is "collide_cube", store it in a std::vector (or what you chose to keep em stored). (Don't put it in the rendering part of the .obj object.)
4: Check if the player is colliding with the world's collide_cubes/collide_spheres.

Now you don't have to check for every triangle or whatever, which would take a long, long time to process.
Post Reply